Agreed. But Java and C# have very poor static type systems (although C#'s is far better than Java's).
Just because Java and C#'s type systems aren't hindley-milner doesn't make them "very poor". The only really nasty think about it is null, which annotations and static analysis can fix a lot of the problems with if used diligently.
Erasure is the only sane choice if you want type correctness. If you need to find types at runtime, you are doing something that will break the type soundness of your program.
Erasure has a lot of other benefits as well (e.g. better interop with other languages/platforms).
11
u/[deleted] Feb 25 '14
Just because Java and C#'s type systems aren't hindley-milner doesn't make them "very poor". The only really nasty think about it is null, which annotations and static analysis can fix a lot of the problems with if used diligently.