JET-72 Type inference doesn't work when iterating over ArrayList:

substitutions fixed for methods inherited from generic superclasses
This commit is contained in:
Andrey Breslav
2011-06-01 18:17:28 +04:00
parent dc25c7bb3b
commit 97de457f79
8 changed files with 98 additions and 16 deletions
@@ -0,0 +1,17 @@
// JET-72 Type inference doesn't work when iterating over ArrayList
import java.util.ArrayList
class Item(val room: Object) {
val name : String
}
val items: ArrayList<Item> = new ArrayList<Item>
fun test(room : Object) {
for(val item: Item in items) {
if (item.room === room) {
System.out?.println("You see " + item.name)
}
}
}