Do not consider descriptors equality as a reason not to refine type

Otherwise, it results in skipping refinement for JobNode when requested
from JVM module while it's necessary because CompletionHandlerBase's content
depends on the module
This commit is contained in:
Denis Zharkov
2019-05-20 18:30:05 +03:00
committed by Dmitry Savvinov
parent 9c27abde7f
commit 2bf6bd3724
4 changed files with 31 additions and 2 deletions
@@ -0,0 +1,11 @@
package foo
internal expect abstract class CompletionHandlerBase() {
abstract fun invoke(cause: Throwable?)
}
internal abstract class JobNode : CompletionHandlerBase()
public typealias CompletionHandler = (cause: Throwable?) -> Unit
fun bar(x: CompletionHandler) { x.hashCode() }
@@ -0,0 +1,15 @@
package foo
private class CancelFutureOnCancel : JobNode() {
override fun invoke(cause: Throwable?) {
}
}
internal actual abstract class CompletionHandlerBase actual constructor() : CompletionHandler {
actual abstract override fun invoke(cause: Throwable?)
}
fun main() {
bar(CancelFutureOnCancel())
}