crazy bug with constructing object of the same class as calling class

This commit is contained in:
Alex Tkachman
2012-01-24 13:30:38 +02:00
parent 5613cb90f9
commit e61a9f62ba
9 changed files with 111 additions and 27 deletions
@@ -0,0 +1,10 @@
class B () {}
open class A(val b : B) {
fun a() = object: A(b) {}
}
fun box() : String {
A(B()).a()
return "OK"
}
@@ -0,0 +1,24 @@
import java.util.concurrent.ConcurrentLinkedQueue
import java.util.List
public object RefreshQueue {
private val queue = ConcurrentLinkedQueue<List<String>>
private val workerThread = Thread(object : Runnable {
override fun run() {
while (!workerThread.isInterrupted()) {
try {
// synchronized(queue) {
// queue.wait()
// }
} catch (e : InterruptedException) {
}
}
}
})
}
fun box() : String {
val t = RefreshQueue.workerThread
return "OK"
}