Files
kotlin-fork/compiler/testData/diagnostics/tests/namedArguments/ambiguousNamedArguments1.fir.kt
T
Tianyu Geng 761a0a7d0d FIR checkers: report specific errors instead of INAPPLICABLE_CANDIDATE
Specifically, the report the following 4 errors.

* NON_VARARG_SPREAD
* ARGUMENT_PASSED_TWICE
* TOO_MANY_ARGUMENTS
* NO_VALUE_FOR_PARAMETER

Also added/updated the following position strategies.
* NAME_OF_NAMED_ARGUMENT
* VALUE_ARGUMENTS
2021-04-02 14:36:14 +03:00

28 lines
471 B
Kotlin
Vendored

interface A {
fun foo(x : Int)
}
interface B {
fun foo(y : Int)
}
interface C : A, B
interface D : B, A
fun foo(x : C, y : D){
x.foo(x = 0)
x.foo(y = 0<!NO_VALUE_FOR_PARAMETER!>)<!>
y.foo(x = 0<!NO_VALUE_FOR_PARAMETER!>)<!>
y.foo(y = 0)
}
abstract class C1 : A, B
abstract class D1 : A, B
fun bar(x : C1, y : D1){
x.foo(x = 0)
x.foo(y = 0<!NO_VALUE_FOR_PARAMETER!>)<!>
y.foo(x = 0)
y.foo(y = 0<!NO_VALUE_FOR_PARAMETER!>)<!>
}