News for hackers. Stuff that matters.
Re:Java 10 – Specification for Value Types by bad_user on Monday June 19, 2017 @02:53AM (#14585021)
It's in fact not type erasure that "rears its ugly head", but actually that Java's type system is not expressive enough, which is why developers end up relying on reflective capabilities.

There's something seriously wrong with the type system when you want "instanceOf T" checks or "new T".

Re:Java 10 – Specification for Value Types by barrkel on Monday June 19, 2017 @04:59AM (#14585488)
There's nothing wrong with doing 'new T' in a generic method or class body. It requires a constraint on the type variable is all: that some constructor with a specific parameter list is available.
Re:Java 10 – Specification for Value Types by kelnos on Monday June 19, 2017 @04:13AM (#14585316)
If you don't have/want "new T", how do you ever create an instance of anything?
Re:Java 10 – Specification for Value Types by chii on Monday June 19, 2017 @04:46AM (#14585440)
The in this context is a variable, not a concrete type.
Re:Java 10 – Specification for Value Types by barrkel on Monday June 19, 2017 @05:05AM (#14585510)
Did you mean: "The T in this context..."?

Instantiating a generic type is like a function call at compile time, where the type arguments are substituted for type parameters in the body of the generic type. It's a variable at compile time, but it's a concrete type at runtime for any version of the code that can execute.