[FE] Report ambiguity in all possible cases
This commit is contained in:
committed by
TeamCityServer
parent
37495bcba0
commit
814777ba8c
+22
@@ -0,0 +1,22 @@
|
||||
interface Common {
|
||||
fun supertypeMember() {}
|
||||
}
|
||||
interface C1 : Common {
|
||||
fun member() {}
|
||||
}
|
||||
interface C2 : Common {
|
||||
fun member() {}
|
||||
}
|
||||
|
||||
fun Common.supertypeExtension() {}
|
||||
|
||||
context(Common)
|
||||
fun supertypeContextual() {}
|
||||
|
||||
context(C1, C2)
|
||||
fun test() {
|
||||
supertypeMember()
|
||||
member()
|
||||
supertypeExtension()
|
||||
supertypeContextual()
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
interface Common {
|
||||
fun supertypeMember() {}
|
||||
}
|
||||
interface C1 : Common {
|
||||
fun member() {}
|
||||
}
|
||||
interface C2 : Common {
|
||||
fun member() {}
|
||||
}
|
||||
|
||||
fun Common.supertypeExtension() {}
|
||||
|
||||
context(Common)
|
||||
fun supertypeContextual() {}
|
||||
|
||||
context(C1, C2)
|
||||
fun test() {
|
||||
<!OVERLOAD_RESOLUTION_AMBIGUITY!>supertypeMember<!>()
|
||||
<!OVERLOAD_RESOLUTION_AMBIGUITY!>member<!>()
|
||||
<!AMBIBIGUOS_CALL_WITH_IMPLICIT_CONTEXT_RECEIVER!>supertypeExtension()<!>
|
||||
<!MULTIPLE_ARGUMENTS_APPLICABLE_FOR_CONTEXT_RECEIVER!>supertypeContextual()<!>
|
||||
}
|
||||
+7
-2
@@ -1,23 +1,28 @@
|
||||
package
|
||||
|
||||
public fun foo(): kotlin.Unit
|
||||
public fun supertypeContextual(): kotlin.Unit
|
||||
public fun test(): kotlin.Unit
|
||||
public fun Common.bar(): kotlin.Unit
|
||||
public fun Common.supertypeExtension(): kotlin.Unit
|
||||
|
||||
public interface C1 : Common {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open fun member(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun supertypeMember(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public interface C2 : Common {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open fun member(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun supertypeMember(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public interface Common {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open fun supertypeMember(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
Vendored
-11
@@ -1,11 +0,0 @@
|
||||
interface C1 {
|
||||
fun foo() {}
|
||||
}
|
||||
interface C2 {
|
||||
fun foo() {}
|
||||
}
|
||||
|
||||
context(C1, C2)
|
||||
fun bar() {
|
||||
foo()
|
||||
}
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
interface C1 {
|
||||
fun foo() {}
|
||||
}
|
||||
interface C2 {
|
||||
fun foo() {}
|
||||
}
|
||||
|
||||
context(C1, C2)
|
||||
fun bar() {
|
||||
<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!>()
|
||||
}
|
||||
-17
@@ -1,17 +0,0 @@
|
||||
package
|
||||
|
||||
public fun bar(): kotlin.Unit
|
||||
|
||||
public interface C1 {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open fun foo(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public interface C2 {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open fun foo(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
interface Common
|
||||
interface C1 : Common
|
||||
interface C2 : Common
|
||||
|
||||
context(Common)
|
||||
fun foo() {}
|
||||
|
||||
fun Common.bar() {}
|
||||
|
||||
context(C1, C2)
|
||||
fun test() {
|
||||
foo()
|
||||
bar()
|
||||
}
|
||||
Vendored
-14
@@ -1,14 +0,0 @@
|
||||
interface Common
|
||||
interface C1 : Common
|
||||
interface C2 : Common
|
||||
|
||||
context(Common)
|
||||
fun foo() {}
|
||||
|
||||
fun Common.bar() {}
|
||||
|
||||
context(C1, C2)
|
||||
fun test() {
|
||||
<!MULTIPLE_ARGUMENTS_APPLICABLE_FOR_CONTEXT_RECEIVER!>foo()<!>
|
||||
bar()
|
||||
}
|
||||
Reference in New Issue
Block a user