FIR / FE 1.0: fix exception for lambda with unresolved name
#KT-46515 Fixed
This commit is contained in:
+6
@@ -12395,6 +12395,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
|
|||||||
runTest("compiler/testData/diagnostics/tests/inference/kt40396.kt");
|
runTest("compiler/testData/diagnostics/tests/inference/kt40396.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt46515.kt")
|
||||||
|
public void testKt46515() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/inference/kt46515.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt6175.kt")
|
@TestMetadata("kt6175.kt")
|
||||||
public void testKt6175() throws Exception {
|
public void testKt6175() throws Exception {
|
||||||
|
|||||||
+6
@@ -12395,6 +12395,12 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
|
|||||||
runTest("compiler/testData/diagnostics/tests/inference/kt40396.kt");
|
runTest("compiler/testData/diagnostics/tests/inference/kt40396.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt46515.kt")
|
||||||
|
public void testKt46515() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/inference/kt46515.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt6175.kt")
|
@TestMetadata("kt6175.kt")
|
||||||
public void testKt6175() throws Exception {
|
public void testKt6175() throws Exception {
|
||||||
|
|||||||
@@ -185,9 +185,12 @@ class FirTowerDataContextsForClassParts(
|
|||||||
modeMap[mode] = value
|
modeMap[mode] = value
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setAnonymousFunctionContext(symbol: FirAnonymousFunctionSymbol) {
|
fun setAnonymousFunctionContextIfAny(symbol: FirAnonymousFunctionSymbol) {
|
||||||
mode = SPECIAL
|
val context = towerDataContextForAnonymousFunctions[symbol]
|
||||||
modeMap[SPECIAL] = towerDataContextForAnonymousFunctions.getValue(symbol)
|
if (context != null) {
|
||||||
|
mode = SPECIAL
|
||||||
|
modeMap[SPECIAL] = context
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setCallableReferenceContextIfAny(access: FirCallableReferenceAccess) {
|
fun setCallableReferenceContextIfAny(access: FirCallableReferenceAccess) {
|
||||||
|
|||||||
+1
-1
@@ -296,7 +296,7 @@ class BodyResolveContext(
|
|||||||
@OptIn(PrivateForInline::class)
|
@OptIn(PrivateForInline::class)
|
||||||
inline fun <T> withAnonymousFunctionTowerDataContext(symbol: FirAnonymousFunctionSymbol, f: () -> T): T {
|
inline fun <T> withAnonymousFunctionTowerDataContext(symbol: FirAnonymousFunctionSymbol, f: () -> T): T {
|
||||||
return withTowerModeCleanup {
|
return withTowerModeCleanup {
|
||||||
towerDataContextsForClassParts.setAnonymousFunctionContext(symbol)
|
towerDataContextsForClassParts.setAnonymousFunctionContextIfAny(symbol)
|
||||||
f()
|
f()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -261,8 +261,8 @@ class ResolvedAtomCompleter(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val substitutedValueParameterTypes = descriptor.valueParameters.mapIndexed { i, valueParameter ->
|
val substitutedValueParameterTypes = descriptor.valueParameters.mapIndexedNotNull { i, valueParameter ->
|
||||||
valueParameterTypes[i].substituteAndApproximate(substitutor).also {
|
valueParameterTypes.getOrNull(i)?.substituteAndApproximate(substitutor)?.also {
|
||||||
if (valueParameter is ValueParameterDescriptorImpl && valueParameter.type.shouldBeUpdated()) {
|
if (valueParameter is ValueParameterDescriptorImpl && valueParameter.type.shouldBeUpdated()) {
|
||||||
valueParameter.setOutType(it.approximatedType)
|
valueParameter.setOutType(it.approximatedType)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
|
// WITH_RUNTIME
|
||||||
|
|
||||||
|
fun bar() {
|
||||||
|
listOf(1, 2, 3).<!NONE_APPLICABLE!>maxOf<!> { <!UNRESOLVED_REFERENCE!>foo<!> }
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
package
|
||||||
|
|
||||||
|
public fun bar(): kotlin.Unit
|
||||||
Generated
+6
@@ -12401,6 +12401,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
|||||||
runTest("compiler/testData/diagnostics/tests/inference/kt40396.kt");
|
runTest("compiler/testData/diagnostics/tests/inference/kt40396.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt46515.kt")
|
||||||
|
public void testKt46515() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/inference/kt46515.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt6175.kt")
|
@TestMetadata("kt6175.kt")
|
||||||
public void testKt6175() throws Exception {
|
public void testKt6175() throws Exception {
|
||||||
|
|||||||
+5
@@ -10791,6 +10791,11 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
|
|||||||
runTest("compiler/testData/diagnostics/tests/inference/kt40396.kt");
|
runTest("compiler/testData/diagnostics/tests/inference/kt40396.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kt46515.kt")
|
||||||
|
public void testKt46515() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/inference/kt46515.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("kt6175.kt")
|
@TestMetadata("kt6175.kt")
|
||||||
public void testKt6175() throws Exception {
|
public void testKt6175() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/tests/inference/kt6175.kt");
|
runTest("compiler/testData/diagnostics/tests/inference/kt6175.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user