Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: 0.9.5
-
Component/s: Runtime (Boo.Lang)
-
Labels:None
-
Number of attachments :
Description
We should provide a generic version of list and hash builtins, with type inference for list/hash literals.
l = [1,2,3]
l.GetType() is typeof(list of int)
h = {1: "Hello", 2: "World"}
h.GetType() is typeof(hash[of int, string])
Type inference can be overridden, like with array literals:
l = [of object: 1,2,3]
l.GetType() is typeof(list of object)
h = {of object, string: 1: "Hello", 2: "World"}
h.GetType() is typeof(hash[of object, string])
Issue Links
| This issue relates to: | ||||
| BOO-448 | Generics |
|
|
|
What about
l = [1,2,3] of object
h = {1: "Hello", 2: "World"} of object, string