[FIR] Allow named arguments for calls of expect functions

This commit is contained in:
Dmitriy Novozhilov
2022-02-16 15:45:18 +03:00
committed by teamcity
parent 44bfb6fde8
commit c116565c0e
2 changed files with 4 additions and 7 deletions
@@ -463,9 +463,6 @@ fun FirFunction.getAsForbiddenNamedArgumentsTarget(session: FirSession): Forbidd
}
}
}
if (status.isExpect) {
return ForbiddenNamedArgumentsTarget.EXPECTED_CLASS_MEMBER
}
return when (origin) {
FirDeclarationOrigin.Source, FirDeclarationOrigin.Precompiled, FirDeclarationOrigin.Library -> null
FirDeclarationOrigin.Delegated -> delegatedWrapperData?.wrapped?.getAsForbiddenNamedArgumentsTarget(session)
@@ -10,10 +10,10 @@ expect class Foo(zzz: Int) {
expect fun f2(xxx: Int)
fun testCommon() {
Foo(<!NAMED_ARGUMENTS_NOT_ALLOWED!>zzz<!> = 0)
val f = Foo(<!NAMED_ARGUMENTS_NOT_ALLOWED!>aaa<!> = true)
f.f1(<!NAMED_ARGUMENTS_NOT_ALLOWED!>xxx<!> = "")
f2(<!NAMED_ARGUMENTS_NOT_ALLOWED!>xxx<!> = 42)
Foo(zzz = 0)
val f = Foo(aaa = true)
f.f1(xxx = "")
f2(xxx = 42)
}
// MODULE: m2-jvm()()(m1-common)