There has been work on AI and self replicating computers for decades- it's always a decade away it seems- but eventually it will happen. Now, if robotics can replace all human tasks, exactly what will the humans do to earn an income to buy the robots to do the tasks?
A little off-topic:
When I worked for Aetna stamping, we were clearing out the old offices upstairs that dated back to WWII when the plant was building warplanes. I found a bunch of old hand drawn blueprints for airplanes in one of the cabinets, realllly cool to think that those planes were designed on paper, entirely out of the engineer's head and error checked by another- based on his knowledge. I wonder how many CAD monkeys could do that if asked to today.