[FIR] Remove the redundant isFunctionType check
^KT-63865 fixed
This commit is contained in:
committed by
Space Team
parent
3a77f39199
commit
1df318ff28
+6
@@ -5266,6 +5266,12 @@ public class DiagnosticCompilerTestFirTestdataTestGenerated extends AbstractDiag
|
|||||||
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/backingField.kt");
|
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/backingField.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("castForFunctionsWithDifferentArities.kt")
|
||||||
|
public void testCastForFunctionsWithDifferentArities() throws Exception {
|
||||||
|
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/castForFunctionsWithDifferentArities.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("classLiteralForParameter.kt")
|
@TestMetadata("classLiteralForParameter.kt")
|
||||||
public void testClassLiteralForParameter() throws Exception {
|
public void testClassLiteralForParameter() throws Exception {
|
||||||
|
|||||||
+6
@@ -5266,6 +5266,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFirTestDataTestGenerated
|
|||||||
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/backingField.kt");
|
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/backingField.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("castForFunctionsWithDifferentArities.kt")
|
||||||
|
public void testCastForFunctionsWithDifferentArities() throws Exception {
|
||||||
|
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/castForFunctionsWithDifferentArities.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("classLiteralForParameter.kt")
|
@TestMetadata("classLiteralForParameter.kt")
|
||||||
public void testClassLiteralForParameter() throws Exception {
|
public void testClassLiteralForParameter() throws Exception {
|
||||||
|
|||||||
Vendored
+12
@@ -0,0 +1,12 @@
|
|||||||
|
FILE: castForFunctionsWithDifferentArities.kt
|
||||||
|
public final fun test(b: R|kotlin/Boolean|, block1: R|kotlin/Any.() -> kotlin/Unit|, block2: R|(kotlin/Any.(kotlin/Any?) -> kotlin/Unit)?|): R|kotlin/Unit| {
|
||||||
|
when () {
|
||||||
|
R|<local>/b| -> {
|
||||||
|
R|kotlin/requireNotNull|<R|kotlin/Any.() -> kotlin/Unit|>(R|<local>/block1|)
|
||||||
|
}
|
||||||
|
else -> {
|
||||||
|
R|kotlin/requireNotNull|<R|kotlin/Any.(kotlin/Any?) -> kotlin/Unit|>(R|<local>/block2|)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Vendored
+9
@@ -0,0 +1,9 @@
|
|||||||
|
// ISSUE: KT-63865
|
||||||
|
|
||||||
|
fun test(b: Boolean, block1: Any.() -> Unit, block2: (Any.(Any?) -> Unit)?) {
|
||||||
|
if (b) {
|
||||||
|
requireNotNull(block1)
|
||||||
|
} else {
|
||||||
|
requireNotNull(block2)
|
||||||
|
}
|
||||||
|
}
|
||||||
+6
@@ -5266,6 +5266,12 @@ public class FirLightTreeDiagnosticsTestGenerated extends AbstractFirLightTreeDi
|
|||||||
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/backingField.kt");
|
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/backingField.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("castForFunctionsWithDifferentArities.kt")
|
||||||
|
public void testCastForFunctionsWithDifferentArities() throws Exception {
|
||||||
|
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/castForFunctionsWithDifferentArities.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("classLiteralForParameter.kt")
|
@TestMetadata("classLiteralForParameter.kt")
|
||||||
public void testClassLiteralForParameter() throws Exception {
|
public void testClassLiteralForParameter() throws Exception {
|
||||||
|
|||||||
+6
@@ -5266,6 +5266,12 @@ public class FirPsiDiagnosticTestGenerated extends AbstractFirPsiDiagnosticTest
|
|||||||
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/backingField.kt");
|
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/backingField.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("castForFunctionsWithDifferentArities.kt")
|
||||||
|
public void testCastForFunctionsWithDifferentArities() throws Exception {
|
||||||
|
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/castForFunctionsWithDifferentArities.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("classLiteralForParameter.kt")
|
@TestMetadata("classLiteralForParameter.kt")
|
||||||
public void testClassLiteralForParameter() throws Exception {
|
public void testClassLiteralForParameter() throws Exception {
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ interface ConeInferenceContext : TypeSystemInferenceExtensionContext, ConeTypeCo
|
|||||||
): SimpleTypeMarker {
|
): SimpleTypeMarker {
|
||||||
val attributesList = attributes?.filterIsInstanceTo<ConeAttribute<*>, MutableList<ConeAttribute<*>>>(mutableListOf())
|
val attributesList = attributes?.filterIsInstanceTo<ConeAttribute<*>, MutableList<ConeAttribute<*>>>(mutableListOf())
|
||||||
val coneAttributes: ConeAttributes = if (isExtensionFunction) {
|
val coneAttributes: ConeAttributes = if (isExtensionFunction) {
|
||||||
require(constructor is ConeClassLikeLookupTag && constructor.isSomeFunctionType(session))
|
require(constructor is ConeClassLikeLookupTag)
|
||||||
// We don't want to create new instance of ConeAttributes which
|
// We don't want to create new instance of ConeAttributes which
|
||||||
// contains only CompilerConeAttributes.ExtensionFunctionType
|
// contains only CompilerConeAttributes.ExtensionFunctionType
|
||||||
// to avoid memory consumption
|
// to avoid memory consumption
|
||||||
|
|||||||
Reference in New Issue
Block a user