C# shipped generics in 2005, one year after Java, and made the opposite trade. The CLR was changed to carry type arguments into the runtime, so List<int> is a real type with a real identity, its own static fields, and its own native code. The list of things erasure forbids is not a list here. What reification costs instead is a runtime that has to know about generics, a JIT that specializes value types and shares reference types, and a dictionary lookup at the seam between those two populations.

This folder makes the contrast concrete rather than asserted. Java’s erasure story is owned by Generics and Type Erasure in Java and linked from here rather than restated, and the cross-language comparison lives in Generics, Monomorphization vs Erasure.

What the runtime keeps

The decision and the machinery under it. Read these in order.

Saying what a type parameter must be

Constraints do more work here than in Java, because the body of a generic method is compiled against them and the runtime honors them.

Variance, decided once by the author

Java asks the caller which wildcard to write. C# asks the library author once, at the declaration, and every call site inherits the answer.

Where reification pays, and where it bills

The rest of the language

Read from the comparative layer


Any pages placed under this folder are auto-listed below by Quartz.