FIR: don't perform argument check for callable references
This fixes failing FIR2IR test
This commit is contained in:
@@ -48,6 +48,9 @@ fun resolveArgumentExpression(
|
||||
isSafeCall,
|
||||
typeProvider
|
||||
)
|
||||
// TODO:!
|
||||
is FirCallableReferenceAccess -> Unit
|
||||
// NB: FirCallableReferenceAccess should be checked earlier
|
||||
is FirQualifiedAccessExpression -> resolvePlainExpressionArgument(
|
||||
csBuilder,
|
||||
argument,
|
||||
@@ -60,8 +63,6 @@ fun resolveArgumentExpression(
|
||||
// TODO:!
|
||||
is FirAnonymousFunction -> preprocessLambdaArgument(csBuilder, argument, expectedType, expectedTypeRef, acceptLambdaAtoms)
|
||||
// TODO:!
|
||||
is FirCallableReferenceAccess -> Unit
|
||||
// TODO:!
|
||||
//TODO: Collection literal
|
||||
is FirWrappedArgumentExpression -> resolveArgumentExpression(
|
||||
csBuilder,
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
class C<T>(var x: T)
|
||||
|
||||
var <T> C<T>.y
|
||||
get() = x
|
||||
set(v) {
|
||||
x = v
|
||||
}
|
||||
|
||||
fun use(f: () -> String) {}
|
||||
|
||||
fun test1() {
|
||||
use { C("abc").y }
|
||||
use(C("abc")::y)
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
FILE: extensionPropertyInLambda.kt
|
||||
public final class C<T> : R|kotlin/Any| {
|
||||
public constructor<T>(x: R|T|): R|C<T>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final var x: R|T| = R|<local>/x|
|
||||
public get(): R|T|
|
||||
public set(value: R|T|): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
public final var <T> R|C<T>|.y: R|T|
|
||||
public get(): R|T| {
|
||||
^ this@R|/C|.R|/C.x|
|
||||
}
|
||||
public set(v: R|T|): R|kotlin/Unit| {
|
||||
this@R|/C|.R|/C.x| = R|<local>/v|
|
||||
}
|
||||
public final fun use(f: R|kotlin/Function0<kotlin/String>|): R|kotlin/Unit| {
|
||||
}
|
||||
public final fun test1(): R|kotlin/Unit| {
|
||||
R|/use|(<L> = use@fun <anonymous>(): R|kotlin/String| <kind=EXACTLY_ONCE> {
|
||||
R|/C.C|<R|kotlin/String|>(String(abc)).R|/y|
|
||||
}
|
||||
)
|
||||
R|/use|(R|/C.C|<R|kotlin/String|>(String(abc))::R|/y|)
|
||||
}
|
||||
+5
@@ -292,6 +292,11 @@ public class FirResolveTestCaseGenerated extends AbstractFirResolveTestCase {
|
||||
runTest("compiler/fir/resolve/testData/resolve/expresssions/dispatchReceiver.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("extensionPropertyInLambda.kt")
|
||||
public void testExtensionPropertyInLambda() throws Exception {
|
||||
runTest("compiler/fir/resolve/testData/resolve/expresssions/extensionPropertyInLambda.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("genericPropertyAccess.kt")
|
||||
public void testGenericPropertyAccess() throws Exception {
|
||||
runTest("compiler/fir/resolve/testData/resolve/expresssions/genericPropertyAccess.kt");
|
||||
|
||||
Reference in New Issue
Block a user