FIR: add more correct handling of Java raw types
This commit is contained in:
@@ -179,7 +179,8 @@ private fun JavaClassifierType.enhanceInflexibleType(
|
||||
} else {
|
||||
val argEnhancedTypeRef = arg.enhancePossiblyFlexible(session, javaTypeParameterStack, annotations, qualifiers, globalArgIndex)
|
||||
globalArgIndex += arg.subtreeSize()
|
||||
argEnhancedTypeRef.type.type.toTypeProjection(Variance.INVARIANT)
|
||||
// For arg == null (raw type) we take <out Any> to match everything
|
||||
argEnhancedTypeRef.type.type.toTypeProjection(if (arg == null) Variance.OUT_VARIANCE else Variance.INVARIANT)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ FILE: test.kt
|
||||
private final val klass: R|java/lang/Class<MyTest>| = <getClass>(this@R|/MyTest|).R|kotlin/jvm/java|
|
||||
private get(): R|java/lang/Class<MyTest>|
|
||||
|
||||
private final val logger: <ERROR TYPE REF: Inapplicable(INAPPLICABLE): [/Logger.getInstance, /Logger.getInstance]> = Q|Logger|.<Inapplicable(INAPPLICABLE): [/Logger.getInstance, /Logger.getInstance]>#(this@R|/MyTest|.R|/MyTest.klass|)
|
||||
private get(): <ERROR TYPE REF: Inapplicable(INAPPLICABLE): [/Logger.getInstance, /Logger.getInstance]>
|
||||
private final val logger: R|ft<Logger, Logger?>!| = Q|Logger|.R|/Logger.getInstance|(this@R|/MyTest|.R|/MyTest.klass|)
|
||||
private get(): R|ft<Logger, Logger?>!|
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user