Generic Java classes supported

This commit is contained in:
Andrey Breslav
2011-04-22 18:25:09 +04:00
parent 55518cd654
commit d9997f3c25
17 changed files with 255 additions and 127 deletions
@@ -76,6 +76,6 @@ fun test() {
for (i in new Range0());
for (i in new Range1());
for (i in (new ArrayList() : List));
for (i in (new ArrayList<Int>() : List<Int>));
}
+6 -4
View File
@@ -2,10 +2,12 @@ import java.*
import util.*
import <error>utils</error>.*
fun test(l : java.util.List) {
val l : List<in Int> = new ArrayList<Int>()
fun test(l : java.util.List<Int>) {
val x : java.<error>List</error>
val y : java.util.List
val y : java.util.List<Int>
val b : java.lang.Object
val a : util.List
val z : java.<error>utils</error>.List
val a : util.List<Int>
val z : java.<error>utils</error>.List<Int>
}
@@ -1 +1 @@
class Foo : java.util.ArrayList
class Foo : java.util.ArrayList<*>
@@ -59,7 +59,7 @@ fun f_plus(): Int {
}
fun <T> tt(t : T) : T {
val x : List = 0
val x : List<Int> = 0
x`java::java.util.List.get()`[1]
val foo = new `Bar()`Bar()
foo`!`[null, 1]