Adding type inference and type erasure part