[nem-en] Some problems with typeof operator (when applied to a tuple type)

Vladimir Reshetnikov v.reshetnikov at gmail.com
Wed Feb 14 19:24:55 CET 2007


[nemerle]
using System.Console;

class A[T,S] { }

WriteLine(typeof(A[_,_]).IsGenericTypeDefinition); // True
WriteLine(typeof(A[_,_]).Equals(typeof(A[object,object]))); // False

WriteLine(typeof(_ * _).IsGenericTypeDefinition); // False
WriteLine(typeof(_ * _).Equals(typeof(object * object))); // True
[/nemerle]

Obviously, that (_ * _) is treated as closed constructed polymorphic
type (object * object), not as unbounded polymorpic type (_ * _), that
is Nemerle.Builtins.Tuple[_,_].
IMO, this is an error.



More information about the devel-en mailing list