Sure, but I don't think it really qualifies as "see, science solves every problem". And what if there are houses everywhere? There will be time slots for rooftops. After a certain size of the houses, there will not be enough rooftops for everyone to get sunshine.
I think in a tradeoff of "There's literally no more room for anybody to live," and "I have to go outside to get sunlight," I'd choose the latter.