FIR resolve: eliminate CallInfo.containingDeclaration as unused
This also fixes potential KNPE during its calculation
This commit is contained in:
@@ -92,8 +92,7 @@ class FirCallResolver(
|
||||
typeArguments,
|
||||
session,
|
||||
file,
|
||||
transformer.components.implicitReceiverStack,
|
||||
transformer.components.container
|
||||
transformer.components.implicitReceiverStack
|
||||
) { it.resultType }
|
||||
towerResolver.reset()
|
||||
|
||||
@@ -156,8 +155,7 @@ class FirCallResolver(
|
||||
emptyList(),
|
||||
session,
|
||||
file,
|
||||
transformer.components.implicitReceiverStack,
|
||||
transformer.components.container
|
||||
transformer.components.implicitReceiverStack
|
||||
) { it.resultType }
|
||||
towerResolver.reset()
|
||||
|
||||
@@ -393,7 +391,6 @@ class FirCallResolver(
|
||||
session,
|
||||
file,
|
||||
transformer.components.implicitReceiverStack,
|
||||
transformer.components.container,
|
||||
expectedType,
|
||||
outerConstraintSystemBuilder,
|
||||
lhs
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
package org.jetbrains.kotlin.fir.resolve.calls
|
||||
|
||||
import org.jetbrains.kotlin.fir.FirSession
|
||||
import org.jetbrains.kotlin.fir.declarations.FirDeclaration
|
||||
import org.jetbrains.kotlin.fir.declarations.FirFile
|
||||
import org.jetbrains.kotlin.fir.declarations.FirValueParameter
|
||||
import org.jetbrains.kotlin.fir.expressions.FirExpression
|
||||
@@ -37,7 +36,6 @@ class CallInfo(
|
||||
val session: FirSession,
|
||||
val containingFile: FirFile,
|
||||
val implicitReceiverStack: ImplicitReceiverStack,
|
||||
val containingDeclaration: FirDeclaration,
|
||||
|
||||
// Three properties for callable references only
|
||||
val expectedType: ConeKotlinType? = null,
|
||||
|
||||
@@ -103,7 +103,6 @@ class InvokeReceiverCandidateCollector(
|
||||
session,
|
||||
invokeCallInfo.containingFile,
|
||||
invokeCallInfo.implicitReceiverStack,
|
||||
invokeCallInfo.containingDeclaration,
|
||||
invokeCallInfo.expectedType,
|
||||
invokeCallInfo.outerCSBuilder,
|
||||
invokeCallInfo.lhs,
|
||||
|
||||
@@ -72,7 +72,6 @@ fun createFunctionConsumer(
|
||||
bodyResolveComponents.session,
|
||||
callInfo.containingFile,
|
||||
callInfo.implicitReceiverStack,
|
||||
callInfo.containingDeclaration,
|
||||
callInfo.expectedType,
|
||||
callInfo.outerCSBuilder,
|
||||
callInfo.lhs,
|
||||
|
||||
+1
-2
@@ -137,8 +137,7 @@ class FirSyntheticCallGenerator(
|
||||
typeArguments = emptyList(),
|
||||
session = session,
|
||||
containingFile = file,
|
||||
implicitReceiverStack = implicitReceiverStack,
|
||||
containingDeclaration = container
|
||||
implicitReceiverStack = implicitReceiverStack
|
||||
) { it.resultType }
|
||||
|
||||
private fun generateSyntheticSelectFunction(callableId: CallableId, isVararg: Boolean = true): FirSimpleFunctionImpl {
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
// Should be something like TYPE_MISMATCH here
|
||||
@file:Some(return x)
|
||||
|
||||
const val x = 42
|
||||
|
||||
annotation class Some(val value: Int)
|
||||
@@ -0,0 +1,13 @@
|
||||
FILE: annotationWithReturn.kt
|
||||
@FILE:R|Some|(^ R|/x|)
|
||||
public final const val x: R|kotlin/Int| = Int(42)
|
||||
public get(): R|kotlin/Int|
|
||||
public final annotation class Some : R|kotlin/Annotation| {
|
||||
public constructor(value: R|kotlin/Int|): R|Some| {
|
||||
super<R|kotlin/Annotation|>()
|
||||
}
|
||||
|
||||
public final val value: R|kotlin/Int| = R|<local>/value|
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
}
|
||||
+5
@@ -389,6 +389,11 @@ public class FirDiagnosticsTestGenerated extends AbstractFirDiagnosticsTest {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/fir/resolve/testData/resolve/expresssions"), Pattern.compile("^([^.]+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("annotationWithReturn.kt")
|
||||
public void testAnnotationWithReturn() throws Exception {
|
||||
runTest("compiler/fir/resolve/testData/resolve/expresssions/annotationWithReturn.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("annotations.kt")
|
||||
public void testAnnotations() throws Exception {
|
||||
runTest("compiler/fir/resolve/testData/resolve/expresssions/annotations.kt");
|
||||
|
||||
Reference in New Issue
Block a user