News for hackers. Stuff that matters.
Re:The Java type system is broken by BonesJustice on Thursday July 19, 2018 @01:54PM (#17568787)
Yeah, compound types like that are a bit of a hack. During type erasure, the type variable gets reduced to its leftmost type (in this case, `String`), so the `main` signature ends up being a valid entry point. Best the compiler can do to enforce the right-hand type constraints is to insert cast instructions where values are used as insances of those types.

As the tweet shows, you still get (some) type safety from the runtime checks.

There are no comments on this comment yet.