<< Getting Sun Java 6 On Debian 4.0 With APT Pinning | Home | JavaScript To Fragment, The End Of The Reign Of The Browsers >>

The Wall Of Erasure

Eric Burke has fallen into a pattern while trying to use Java generics:

Eric Burke:
... I foolishly tried this:
... Oops. Won’t compile.
... Foiled by erasure!

Brian Gilstrap, who's also experimenting with generics, has coined a name for this phenomenon—The Wall Of Erasure.

In plain English: Every really cool idea involving Java generics will invariably lead to insurmountable difficulties the root cause of which is erasure.

Tags :


Re: The Wall Of Erasure

Brian seemed to hit the wall of not understanding generics, not erasure. He only needs a "? extends Superclass" in his DoesStuff interface's iterator method. Sad that people assume the language is faulty. It is, but not in every case.

Re: The Wall Of Erasure

Unfortunately, Ricky's suggestion is broken as soon as I try to make things Iterable. I get a type clash that (from what I can tell) can't be resolved. Smacked by the Wall of Erasure again...

Re: The Wall Of Erasure

Brian's error can be resolved, but he hasn't approved the comment in which I resolve it.

The wall of erasure is real, but this isn't where you hit it.


Add a comment Send a TrackBack