A dystopian megacity, in which buildings merge together to become a single solid block, is the stuff of science fiction — but it already happened, in Hong Kong. The Kowloon Walled City was packed so tightly, it became an arcology.
Kowloon Walled City arose out of a weird circumstance in the treaty between the Brits and the Chinese that created Hong Kong. China gave the New Territories to the Brits in 1898 but excluded the Walled City, which the Chinese wanted to be able to use as an outpost. The Walled City developed a kind of status as a no-man's land — but it was really only after the Japanese surrendered after World War II that the Walled City became totally ungoverned, with neither the Chinese nor the British exercising control.
The result was a tightly contained but fast-growing city, with buildings being added on top of each other and every inch of space being used. The Wikipedia page has some great stats, including the fact that the average apartment in the City was only 250 square feet, and there were 33,000 residents occupying the 6.5 acre region in 1987. The construction was so dense that sunlight didn't filter down to the lower levels, which were lit by fluorescent lights.
The city reached a uniform height of around 10 storeys but couldn't grow much higher, because it was so close to Kai Tak Airport. The whole thing was torn down in the early 1990s, and a park was built on the site — including a scale model of the Walled City.