Does anyone know how they've gotten around the issue of Type Erasure on the JVM?
Does anyone know how they've gotten around the issue of Type Erasure on the JVM?
"you can add objects to a collection, but not primitives".
Why not?
"The collection and list classes used frequently in Gosu rely on the Java language’s collection classes. However, there are important differences because of built-in enhancements to these classes that use Gosu blocks, anonymous in-line defined functions that are not directly supported in the Java language."
It also has some type-inference that converts:
var str = {"foo", "bar", "baz"}
To ArrayList<String> str = new ArrayList<String>();
str.add("foo").add("bar").add("baz");
Or some such.LtU wont be going wild over this any time soon.
"Gosu types preserve generic type information at run time. This Gosu feature is called reified generics. This means that in complex cases you could check the exact type of an object at run time, including any parameterization. In contrast, Java discards this information completely after compilation, so it is unavailable at run time.
"Note: Even in Gosu, parameterization information is unavailable for all native Java types because Java does not preserve this information beyond compile time. For example the run time type of java.util.List<Address> in Gosu returns the unparameterized type java.util.List."
From http://gosu-lang.org/doc/wwhelp/wwhimpl/js/html/wwhelp.htm#h...