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:
committed by
Dmitry Savvinov
parent
9c27abde7f
commit
2bf6bd3724
@@ -100,8 +100,6 @@ object KotlinTypeFactory {
|
||||
val basicDescriptor = constructor.declarationDescriptor
|
||||
val descriptor = basicDescriptor?.let { kotlinTypeRefiner.refineDescriptor(it) } ?: return null
|
||||
|
||||
if (descriptor == basicDescriptor) return null
|
||||
|
||||
if (descriptor is TypeAliasDescriptor) {
|
||||
return ExpandedTypeOrRefinedConstructor(descriptor.computeExpandedType(arguments), null)
|
||||
}
|
||||
|
||||
+11
@@ -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() }
|
||||
+15
@@ -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())
|
||||
}
|
||||
Generated
+5
@@ -44,6 +44,11 @@ public class MultiPlatformHighlightingTestGenerated extends AbstractMultiPlatfor
|
||||
runTest("idea/testData/multiModuleHighlighting/multiplatform/catchHeaderExceptionInPlatformModule/");
|
||||
}
|
||||
|
||||
@TestMetadata("completionHandlexCoroutines")
|
||||
public void testCompletionHandlexCoroutines() throws Exception {
|
||||
runTest("idea/testData/multiModuleHighlighting/multiplatform/completionHandlexCoroutines/");
|
||||
}
|
||||
|
||||
@TestMetadata("contracts")
|
||||
public void testContracts() throws Exception {
|
||||
runTest("idea/testData/multiModuleHighlighting/multiplatform/contracts/");
|
||||
|
||||
Reference in New Issue
Block a user