A syntax option (function types versus arrays)
Gernot Neppert
mcnepp02 at googlemail.com
Mon Mar 1 06:19:10 PST 2010
I may be missing something here, but I don't understand why the
discussion about type-safety of closures deals only with arrays of
closures.
Isn't the root cause for the type-safety-problem the lack of a
comprehensive runtime-type-info that preserves the entire signature of
the closure?
Isn't this exactly the same problem that we're having with erased
generic types already today?
This code yields an 'unchecked' warning in current Java:
Object obj = new ArrayList<String>();
List<String> list = (ArrayList<String>)obj;
I do not see how that differs from a similar situation with closures:
Object obj = #void() { System.out.println("hello world"); };
#void() closure = (#void())obj;
This should also trigger an 'unchecked' warning, right?
More information about the lambda-dev
mailing list