All objects have a single .type
. Lambdas also have a list of .signatures
, each unique, one for each overload. Each signature is a type.
a = 42
b = :rip
c = -> (a) { a + a }
d = -> (a<System.Integer>, b<System.Integer> = 0) { a + b }
a.type #=> System.Integer
b.type #=> System.String
c.type #=> System.Lambda
d.type #=> System.Lambda
c.signatures #=> [ System.Lambda<System.Object> ]
d.signatures #=> [ System.Lambda<System.Integer>, System.Lambda<System.Integer, System.Integer> ]
- If a lambda has only one signature, should its type match that signature, or should the type of every lambda always be the generic
System.Lambda
?