[NI] Fix extension function check after commonization
`isExtensionFunction` property is false for suspend functions
This commit is contained in:
Generated
+5
@@ -13334,6 +13334,11 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
|||||||
runTest("compiler/testData/codegen/box/inference/subtypingOfIntersectionIltInsideFlexible.kt");
|
runTest("compiler/testData/codegen/box/inference/subtypingOfIntersectionIltInsideFlexible.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("suspendExtensionRecevierFromConstraint.kt")
|
||||||
|
public void testSuspendExtensionRecevierFromConstraint() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/inference/suspendExtensionRecevierFromConstraint.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("unsafeVarianceCodegen.kt")
|
@TestMetadata("unsafeVarianceCodegen.kt")
|
||||||
public void testUnsafeVarianceCodegen() throws Exception {
|
public void testUnsafeVarianceCodegen() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/inference/unsafeVarianceCodegen.kt");
|
runTest("compiler/testData/codegen/box/inference/unsafeVarianceCodegen.kt");
|
||||||
|
|||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
// WITH_RUNTIME
|
||||||
|
// KJS_WITH_FULL_RUNTIME
|
||||||
|
// !LANGUAGE: +NewInference
|
||||||
|
|
||||||
|
class ExtensionReceiver
|
||||||
|
typealias SuspendExtensionFunction = suspend ExtensionReceiver.() -> Unit
|
||||||
|
suspend fun ExtensionReceiver.extensionMethod() {}
|
||||||
|
|
||||||
|
fun test() {
|
||||||
|
val map = mutableMapOf<Unit, SuspendExtensionFunction>()
|
||||||
|
|
||||||
|
map[Unit] = {
|
||||||
|
extensionMethod()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
test()
|
||||||
|
return "OK"
|
||||||
|
}
|
||||||
+5
@@ -14729,6 +14729,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
|||||||
runTest("compiler/testData/codegen/box/inference/subtypingOfIntersectionIltInsideFlexible.kt");
|
runTest("compiler/testData/codegen/box/inference/subtypingOfIntersectionIltInsideFlexible.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("suspendExtensionRecevierFromConstraint.kt")
|
||||||
|
public void testSuspendExtensionRecevierFromConstraint() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/inference/suspendExtensionRecevierFromConstraint.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("unsafeVarianceCodegen.kt")
|
@TestMetadata("unsafeVarianceCodegen.kt")
|
||||||
public void testUnsafeVarianceCodegen() throws Exception {
|
public void testUnsafeVarianceCodegen() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/inference/unsafeVarianceCodegen.kt");
|
runTest("compiler/testData/codegen/box/inference/unsafeVarianceCodegen.kt");
|
||||||
|
|||||||
+5
@@ -14729,6 +14729,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
|||||||
runTest("compiler/testData/codegen/box/inference/subtypingOfIntersectionIltInsideFlexible.kt");
|
runTest("compiler/testData/codegen/box/inference/subtypingOfIntersectionIltInsideFlexible.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("suspendExtensionRecevierFromConstraint.kt")
|
||||||
|
public void testSuspendExtensionRecevierFromConstraint() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/inference/suspendExtensionRecevierFromConstraint.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("unsafeVarianceCodegen.kt")
|
@TestMetadata("unsafeVarianceCodegen.kt")
|
||||||
public void testUnsafeVarianceCodegen() throws Exception {
|
public void testUnsafeVarianceCodegen() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/inference/unsafeVarianceCodegen.kt");
|
runTest("compiler/testData/codegen/box/inference/unsafeVarianceCodegen.kt");
|
||||||
|
|||||||
+5
@@ -13334,6 +13334,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
|||||||
runTest("compiler/testData/codegen/box/inference/subtypingOfIntersectionIltInsideFlexible.kt");
|
runTest("compiler/testData/codegen/box/inference/subtypingOfIntersectionIltInsideFlexible.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("suspendExtensionRecevierFromConstraint.kt")
|
||||||
|
public void testSuspendExtensionRecevierFromConstraint() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/inference/suspendExtensionRecevierFromConstraint.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("unsafeVarianceCodegen.kt")
|
@TestMetadata("unsafeVarianceCodegen.kt")
|
||||||
public void testUnsafeVarianceCodegen() throws Exception {
|
public void testUnsafeVarianceCodegen() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/inference/unsafeVarianceCodegen.kt");
|
runTest("compiler/testData/codegen/box/inference/unsafeVarianceCodegen.kt");
|
||||||
|
|||||||
@@ -680,7 +680,7 @@ interface ClassicTypeSystemContext : TypeSystemInferenceExtensionContext, TypeSy
|
|||||||
|
|
||||||
override fun KotlinTypeMarker.isExtensionFunctionType(): Boolean {
|
override fun KotlinTypeMarker.isExtensionFunctionType(): Boolean {
|
||||||
require(this is KotlinType, this::errorMessage)
|
require(this is KotlinType, this::errorMessage)
|
||||||
return this.isExtensionFunctionType
|
return this.isBuiltinExtensionFunctionalType
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun KotlinTypeMarker.extractArgumentsForFunctionalTypeOrSubtype(): List<KotlinTypeMarker> {
|
override fun KotlinTypeMarker.extractArgumentsForFunctionalTypeOrSubtype(): List<KotlinTypeMarker> {
|
||||||
|
|||||||
Generated
+5
@@ -11434,6 +11434,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
|
|||||||
runTest("compiler/testData/codegen/box/inference/referenceToCatchParameterFromLambdaExpression.kt");
|
runTest("compiler/testData/codegen/box/inference/referenceToCatchParameterFromLambdaExpression.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("suspendExtensionRecevierFromConstraint.kt")
|
||||||
|
public void testSuspendExtensionRecevierFromConstraint() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/inference/suspendExtensionRecevierFromConstraint.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("unsafeVarianceCodegen.kt")
|
@TestMetadata("unsafeVarianceCodegen.kt")
|
||||||
public void testUnsafeVarianceCodegen() throws Exception {
|
public void testUnsafeVarianceCodegen() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/inference/unsafeVarianceCodegen.kt");
|
runTest("compiler/testData/codegen/box/inference/unsafeVarianceCodegen.kt");
|
||||||
|
|||||||
Generated
+5
@@ -11434,6 +11434,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
|||||||
runTest("compiler/testData/codegen/box/inference/referenceToCatchParameterFromLambdaExpression.kt");
|
runTest("compiler/testData/codegen/box/inference/referenceToCatchParameterFromLambdaExpression.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("suspendExtensionRecevierFromConstraint.kt")
|
||||||
|
public void testSuspendExtensionRecevierFromConstraint() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/inference/suspendExtensionRecevierFromConstraint.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("unsafeVarianceCodegen.kt")
|
@TestMetadata("unsafeVarianceCodegen.kt")
|
||||||
public void testUnsafeVarianceCodegen() throws Exception {
|
public void testUnsafeVarianceCodegen() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/inference/unsafeVarianceCodegen.kt");
|
runTest("compiler/testData/codegen/box/inference/unsafeVarianceCodegen.kt");
|
||||||
|
|||||||
+5
@@ -11499,6 +11499,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
|||||||
runTest("compiler/testData/codegen/box/inference/referenceToCatchParameterFromLambdaExpression.kt");
|
runTest("compiler/testData/codegen/box/inference/referenceToCatchParameterFromLambdaExpression.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("suspendExtensionRecevierFromConstraint.kt")
|
||||||
|
public void testSuspendExtensionRecevierFromConstraint() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/inference/suspendExtensionRecevierFromConstraint.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("unsafeVarianceCodegen.kt")
|
@TestMetadata("unsafeVarianceCodegen.kt")
|
||||||
public void testUnsafeVarianceCodegen() throws Exception {
|
public void testUnsafeVarianceCodegen() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/inference/unsafeVarianceCodegen.kt");
|
runTest("compiler/testData/codegen/box/inference/unsafeVarianceCodegen.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user