Files
kotlin-fork/compiler/testData/diagnostics/tests/regressions/Jet72.kt
T
Andrey Breslav 3d8d92c7d3 JetDiagnosticsTest migrated to TestGenerator
- test data files renamed from *.jet to *.kt
2012-07-10 14:48:11 +04:00

18 lines
371 B
Kotlin

// JET-72 Type inference doesn't work when iterating over ArrayList
import java.util.ArrayList
abstract class Item(val room: Object) {
abstract val name : String
}
val items: ArrayList<Item> = ArrayList<Item>()
fun test(room : Object) {
for(val item: Item? in items) {
if (item?.room === room) {
System.out.println("You see " + item?.name)
}
}
}