In a large bowl, combine flour, sugar, brown sugar, baking soda and salt. Stir in pineapple and walnuts. Pour into a greased 13-in. x 9-in. baking pan. Bake at 350° for 35 minutes or until a toothpick inserted near the center comes out clean. Cool 5 minutes on a wire rack.
For icing, combine sugar, butter and milk in a small saucepan over medium-high heat. Bring to a boil and boil for 2 minutes. Pour over warm cake. Sprinkle with coconut if desired.