Create FIR fake source element for vararg argument expression

This commit is contained in:
Mikhail Glukhikh
2020-11-17 18:40:33 +03:00
parent fa3f805573
commit c602ccb33e
2 changed files with 5 additions and 1 deletions
@@ -58,7 +58,7 @@ internal fun remapArgumentsWithVararg(
) {
arguments += arg
if (this.source == null) {
this.source = arg.source
this.source = arg.source?.fakeElement(FirFakeSourceElementKind.VarargArgument)
}
} else if (arguments.isEmpty()) {
// `arg` is BEFORE the vararg arguments.
@@ -150,6 +150,10 @@ sealed class FirFakeSourceElementKind : FirSourceElementKind() {
// super.foo() --> super<Supertype>.foo()
// where `Supertype` has a fake source
object SuperCallImplicitType : FirFakeSourceElementKind()
// fun foo(vararg args: Int) {}
// fun bar(1, 2, 3) --> [resolved] fun bar(VarargArgument(1, 2, 3))
object VarargArgument : FirFakeSourceElementKind()
}
sealed class FirSourceElement {