Go look up the sources for the Scala 2.8.0 compiler.
Worst and most difficult to understand code I have ever seen. It is simultaneously confusing, hard, badly commented and uses every single Scala feature I have ever seen, including non-root imports in the middle of files, extensions of anonymous classes sometimes with other anonymous classes, and my least favourite: path depended typing (sometimes from non-root imports started in one of several traits that may or may not have circular inherietence patterns).
But that said, it has never been a problem outside the compiler.
That's pretty interesting, because I had no trouble reading and understanding the sources of the compiler and writing simple patches for it ... and I'm not really a compiler guy and not a type theorist.
The Scala compiler is in my opinion one of the nicest code bases I've seen, considering the low-level stuff happening there.
https://github.com/languages/Scala