19 lines
375 B
Plaintext
19 lines
375 B
Plaintext
// JET-72 Type inference doesn't work when iterating over ArrayList
|
|
// +JDK
|
|
|
|
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)
|
|
}
|
|
}
|
|
}
|