crazy bug with constructing object of the same class as calling class
This commit is contained in:
@@ -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"
|
||||
}
|
||||
Reference in New Issue
Block a user