I remember on time I dreamed I was working in my 3D program continuing to create a model that I had been working on that day. Man, I was pissed when I woke up and realized I hadn't actually done the last half of the work in real life.
One strange thing that happened to me is when I had this dream (following some long and deep programming session) where the "reality rules" were very close to the logical spirit of programming. Suddenly if I had to reach a platform that was very high, I could just "imagine and build my own tools" to add new abilities to my being. Very difficult to explain. I could clone objects if needed. I could somehow "loop" things or actions. etc.
As far as I know I did not solve any programming problem with this dream though.