File tree Expand file tree Collapse file tree 3 files changed +11
-6
lines changed
frontend/src/org/jetbrains/kotlin/resolve/calls
testData/diagnostics/tests/namedArguments Expand file tree Collapse file tree 3 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 22
22
import org .jetbrains .annotations .NotNull ;
23
23
import org .jetbrains .annotations .Nullable ;
24
24
import org .jetbrains .kotlin .builtins .functions .FunctionInvokeDescriptor ;
25
- import org .jetbrains .kotlin .descriptors .CallableDescriptor ;
26
- import org .jetbrains .kotlin .descriptors .ValueParameterDescriptor ;
25
+ import org .jetbrains .kotlin .descriptors .*;
27
26
import org .jetbrains .kotlin .diagnostics .Diagnostic ;
28
27
import org .jetbrains .kotlin .name .Name ;
29
28
import org .jetbrains .kotlin .psi .*;
@@ -164,7 +163,8 @@ public ProcessorState processNamedArgument(@NotNull ValueArgument argument) {
164
163
));
165
164
}
166
165
167
- if (candidate .hasStableParameterNames () && nameReference != null && valueParameterDescriptor != null ) {
166
+ if (candidate .hasStableParameterNames () && nameReference != null && valueParameterDescriptor != null &&
167
+ candidate instanceof CallableMemberDescriptor && ((CallableMemberDescriptor )candidate ).getKind () == CallableMemberDescriptor .Kind .FAKE_OVERRIDE ) {
168
168
for (ValueParameterDescriptor parameterFromSuperclass : valueParameterDescriptor .getOverriddenDescriptors ()) {
169
169
if (OverrideResolver .shouldReportParameterNameOverrideWarning (valueParameterDescriptor , parameterFromSuperclass )) {
170
170
report (NAME_FOR_AMBIGUOUS_PARAMETER .on (nameReference ));
Original file line number Diff line number Diff line change @@ -13,6 +13,10 @@ interface D : C {
13
13
override fun foo (<!PARAMETER_NAME_CHANGED_ON_OVERRIDE !>d1<!>: Int , <!PARAMETER_NAME_CHANGED_ON_OVERRIDE !>d2<!>: Double )
14
14
}
15
15
16
- fun test (d : D ) {
17
- d.foo(< ! NAME_FOR_AMBIGUOUS_PARAMETER ! > d1< ! > = 1 , < ! NAME_FOR_AMBIGUOUS_PARAMETER ! > d2< ! > = 1.0 )
16
+ fun test1 (d : D ) {
17
+ d.foo(d1 = 1 , d2 = 1.0 )
18
+ }
19
+
20
+ fun test2 (c : C ) {
21
+ c.foo(< ! NAME_FOR_AMBIGUOUS_PARAMETER ! > b1< ! > = 1 , < ! NAME_FOR_AMBIGUOUS_PARAMETER ! > b2< ! > = 1.0 )
18
22
}
Original file line number Diff line number Diff line change 1
1
package
2
2
3
- public fun test(/*0*/ d: D): kotlin.Unit
3
+ public fun test1(/*0*/ d: D): kotlin.Unit
4
+ public fun test2(/*0*/ c: C): kotlin.Unit
4
5
5
6
public interface A {
6
7
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
You can’t perform that action at this time.
0 commit comments