[nem-en] Re: typeof for unbounded polymorphic type
Kamil Skalski
kamil.skalski at gmail.com
Tue Feb 6 15:55:18 CET 2007
You must use
[1 : object, 2, "a"]
Type inference works bottom-up, so compiler tries to type
[1,2,"a"]
by itself as valid expression, which it is not.
The information from the outside is used only if there are some parts,
which might be valid, but type compiler does not yet know full types:
def obj = null;
def x = [obj.foo, obj.bar];
obj = X(); // info from outside used for typing list in 'x'
2007/2/6, Vladimir Reshetnikov <V.Reshetnikov at gmail.com>:
> And why this does not work?
>
> def x : list[object] = [1,2,"a"];
>
>
>
> _______________________________________________
> https://nemerle.org/mailman/listinfo/devel-en
>
--
Kamil Skalski
http://nazgul.omega.pl
More information about the devel-en
mailing list