Top "Type-erasure" questions

In Java, type erasure is the process where the compiler removes all information related to type parameters and type arguments within a class or method when a generic type is instantiated.

What are the benefits of Java's types erasure?

I read a tweet today that said: It's funny when Java users complain about type erasure, which is the only …

java type-erasure
Why does a Java generic raw class erase all generics to object when type parameters are unspecified?

If I have a class: public class GenericClass<TBlah extends Number> { public List<String> getList() { return …

java generics type-erasure
Java:How to override this generic method?

public <S extends T> List<S> save(Iterable<S> entities) { //... } If I use following …

java generics overriding type-erasure
Scala: abstract type pattern A is unchecked since it is eliminated by erasure

I am writing the function that can catch exceptions of the certain type only. def myFunc[A <: Exception]() { try { …

scala generics functional-programming type-erasure scala-template
Java erasure with generic overloading (not overriding)

I have FinanceRequests and CommisionTransactions in my domain. If I have a list of FinanceRequests each FinanceRequest could contain multiple …

java generics overloading type-erasure
How to overload a method with generic parameter in java?

I have FinanceRequests and CommisionTransactions in my domain. If I have a list of FinanceRequests each FinanceRequest could contain multiple …

java generics type-erasure
std::variant reflection. How can I tell which type of value std::variant is assigned?

I have a class called foo_t that has a member called bar which could be any one of the …

c++ reflection std variant type-erasure
Using collect on maps in Scala

I recently stumbled over this post, which "introduces" the collect method for Scala collections. The usage is straight forward: scala&…

scala compiler-construction jvm scala-collections type-erasure
Why following types are reifiable& non-reifiable in java?

In computing, reification has come to mean an explicit representation of a type—that is, run-time type information. oracle tutorials …

java generics type-erasure
What's the cost of typeid?

I'm considering a type erasure setup that uses typeid to resolve the type like so... struct BaseThing { virtual ~BaseThing() = 0 {} }; template&…

c++ c++11 type-erasure