Merge: New syntax for typed literal arrays
authorJean Privat <jean@pryen.org>
Thu, 25 Sep 2014 21:41:09 +0000 (17:41 -0400)
committerJean Privat <jean@pryen.org>
Thu, 25 Sep 2014 21:41:09 +0000 (17:41 -0400)
commitf8d914fca3bb0f1952896f1c1c197df23b62ca07
tree67d1201699c26f56575be50b6dfe2178ea890405
parente48cfb3c5cc0b3f88449eb1fb6463c986e71df14
parent023ca765e1d1de4bae44c00d4947be5b46cb018c
Merge: New syntax for typed literal arrays

Currenlty there is only
~~~.nit
var a = [1, 2] # a isa Array[Int]
var b = [1, true] # Type Error: ambiguous array type Int Bool
var c = new Array[Object].with_items(1, true) # c isa Array[Object]
~~~

Now, there is also
~~~.nit
var d = [1, true: Object] # d isa Array[Object]
var e = [1, 2: Numeric] # e isa Array[Numeric]
var f = [1, 2: Int] # f isa Array[Int] but with a warning for the useless `:Int`
~~~

Pull-Request: #772
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
src/semantize/typing.nit