[FE] Make OverloadChecker take CR into account

This commit is contained in:
Anastasia.Shadrina
2021-12-14 06:39:51 +07:00
committed by teamcity
parent 2bb155edc1
commit 343a860553
14 changed files with 259 additions and 4 deletions
@@ -0,0 +1,18 @@
// !LANGUAGE: +ContextReceivers
interface A
interface B
<!CONFLICTING_OVERLOADS!>context(A, B)
fun f(): Unit<!> = TODO()
<!CONFLICTING_OVERLOADS!>context(A, B)
fun f(): Unit<!> = TODO()
fun test(a: A, b: B) {
with(a) {
with(b) {
f()
}
}
}
@@ -0,0 +1,18 @@
// !LANGUAGE: +ContextReceivers
interface A
interface B
<!CONFLICTING_OVERLOADS!>context(A, B)
fun f(): Unit<!> = TODO()
<!CONFLICTING_OVERLOADS!>context(A, B)
fun f(): Unit<!> = TODO()
fun test(a: A, b: B) {
with(a) {
with(b) {
<!OVERLOAD_RESOLUTION_AMBIGUITY!>f<!>()
}
}
}
@@ -0,0 +1,17 @@
package
context(A, B) public fun f(): kotlin.Unit
context(A, B) public fun f(): kotlin.Unit
public fun test(/*0*/ a: A, /*1*/ b: B): kotlin.Unit
public interface A {
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 override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public interface B {
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 override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
@@ -0,0 +1,18 @@
// !LANGUAGE: +ContextReceivers
interface A
interface B
<!CONFLICTING_OVERLOADS!>context(A, B)
fun f(): Unit<!> = TODO()
<!CONFLICTING_OVERLOADS!>context(B, A)
fun f(): Unit<!> = TODO()
fun test(a: A, b: B) {
with(a) {
with(b) {
f()
}
}
}
@@ -0,0 +1,18 @@
// !LANGUAGE: +ContextReceivers
interface A
interface B
context(A, B)
fun f(): Unit = TODO()
context(B, A)
fun f(): Unit = TODO()
fun test(a: A, b: B) {
with(a) {
with(b) {
<!OVERLOAD_RESOLUTION_AMBIGUITY!>f<!>()
}
}
}
@@ -0,0 +1,17 @@
package
context(A, B) public fun f(): kotlin.Unit
context(B, A) public fun f(): kotlin.Unit
public fun test(/*0*/ a: A, /*1*/ b: B): kotlin.Unit
public interface A {
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 override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public interface B {
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 override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
@@ -0,0 +1,20 @@
// !LANGUAGE: +ContextReceivers
interface A
interface B
interface C
interface D
<!CONFLICTING_OVERLOADS!>context(A, B)
fun f(): Unit<!> = TODO()
<!CONFLICTING_OVERLOADS!>context(C, D)
fun f(): Unit<!> = TODO()
fun test(a: A, b: B) {
with(a) {
with(b) {
f()
}
}
}
@@ -0,0 +1,20 @@
// !LANGUAGE: +ContextReceivers
interface A
interface B
interface C
interface D
context(A, B)
fun f(): Unit = TODO()
context(C, D)
fun f(): Unit = TODO()
fun test(a: A, b: B) {
with(a) {
with(b) {
f()
}
}
}
@@ -0,0 +1,29 @@
package
context(A, B) public fun f(): kotlin.Unit
context(C, D) public fun f(): kotlin.Unit
public fun test(/*0*/ a: A, /*1*/ b: B): kotlin.Unit
public interface A {
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 override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public interface B {
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 override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public interface C {
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 override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public interface D {
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 override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}