Fix resolve (members/extensions with 'infix' has higher priority)
This commit is contained in:
+41
@@ -0,0 +1,41 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
class Example
|
||||
|
||||
fun Example.plus(other: Example) = 0
|
||||
operator infix fun Example.minus(other: Example) = 0
|
||||
|
||||
operator infix fun Example.times(other: Example) = 0
|
||||
fun Example.div(other: Example) = 0
|
||||
|
||||
fun a() {
|
||||
with (Example()) {
|
||||
operator infix fun Example.plus(other: Example) = ""
|
||||
fun Example.minus(other: Example) = ""
|
||||
|
||||
operator infix fun Example.times(other: Example) = ""
|
||||
fun Example.div(other: Example) = ""
|
||||
|
||||
with (Example()) {
|
||||
val a = Example()
|
||||
val b = Example()
|
||||
|
||||
consumeString(a + b)
|
||||
consumeInt(a - b)
|
||||
|
||||
consumeString(a plus b)
|
||||
consumeInt(a minus b)
|
||||
|
||||
a <!OVERLOAD_RESOLUTION_AMBIGUITY!>*<!> b
|
||||
a <!OVERLOAD_RESOLUTION_AMBIGUITY!>/<!> b
|
||||
|
||||
a <!OVERLOAD_RESOLUTION_AMBIGUITY!>times<!> b
|
||||
a <!OVERLOAD_RESOLUTION_AMBIGUITY!>div<!> b
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public fun <T, R> with(receiver: T, f: T.() -> R): R = receiver.f()
|
||||
|
||||
fun consumeInt(i: Int) {}
|
||||
fun consumeString(s: String) {}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package
|
||||
|
||||
public fun a(): kotlin.Unit
|
||||
public fun consumeInt(/*0*/ i: kotlin.Int): kotlin.Unit
|
||||
public fun consumeString(/*0*/ s: kotlin.String): kotlin.Unit
|
||||
public fun </*0*/ T, /*1*/ R> with(/*0*/ receiver: T, /*1*/ f: T.() -> R): R
|
||||
public fun Example.div(/*0*/ other: Example): kotlin.Int
|
||||
public operator infix fun Example.minus(/*0*/ other: Example): kotlin.Int
|
||||
public fun Example.plus(/*0*/ other: Example): kotlin.Int
|
||||
public operator infix fun Example.times(/*0*/ other: Example): kotlin.Int
|
||||
|
||||
public final class Example {
|
||||
public constructor Example()
|
||||
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
|
||||
}
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
class Example {
|
||||
operator infix fun plus(other: Example) = 0
|
||||
fun minus(other: Example) = 0
|
||||
|
||||
operator infix fun times(other: Example) = 0
|
||||
fun div(other: Example) = 0
|
||||
}
|
||||
|
||||
fun Example.plus(other: Example) = ""
|
||||
operator infix fun Example.minus(other: Example) = ""
|
||||
|
||||
operator infix fun Example.times(other: Example) = ""
|
||||
fun Example.div(other: Example) = ""
|
||||
|
||||
fun a() {
|
||||
val a = Example()
|
||||
val b = Example()
|
||||
|
||||
a + b
|
||||
a - b
|
||||
a * b
|
||||
a <!OPERATOR_MODIFIER_REQUIRED!>/<!> b
|
||||
|
||||
a plus b
|
||||
a minus b
|
||||
a times b
|
||||
a <!INFIX_MODIFIER_REQUIRED!>div<!> b
|
||||
|
||||
with (Example()) {
|
||||
consumeInt(this + a)
|
||||
consumeString(this - b)
|
||||
consumeInt(this * a)
|
||||
consumeInt(this <!OPERATOR_MODIFIER_REQUIRED!>/<!> b)
|
||||
|
||||
consumeInt(this plus a)
|
||||
consumeString(this minus b)
|
||||
consumeInt(this times a)
|
||||
consumeInt(this <!INFIX_MODIFIER_REQUIRED!>div<!> b)
|
||||
}
|
||||
}
|
||||
|
||||
public fun <T, R> with(receiver: T, f: T.() -> R): R = receiver.f()
|
||||
|
||||
fun consumeInt(i: Int) {}
|
||||
fun consumeString(s: String) {}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package
|
||||
|
||||
public fun a(): kotlin.Unit
|
||||
public fun consumeInt(/*0*/ i: kotlin.Int): kotlin.Unit
|
||||
public fun consumeString(/*0*/ s: kotlin.String): kotlin.Unit
|
||||
public fun </*0*/ T, /*1*/ R> with(/*0*/ receiver: T, /*1*/ f: T.() -> R): R
|
||||
public fun Example.div(/*0*/ other: Example): kotlin.String
|
||||
public operator infix fun Example.minus(/*0*/ other: Example): kotlin.String
|
||||
public fun Example.plus(/*0*/ other: Example): kotlin.String
|
||||
public operator infix fun Example.times(/*0*/ other: Example): kotlin.String
|
||||
|
||||
public final class Example {
|
||||
public constructor Example()
|
||||
public final fun div(/*0*/ other: Example): kotlin.Int
|
||||
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 final fun minus(/*0*/ other: Example): kotlin.Int
|
||||
public final operator infix fun plus(/*0*/ other: Example): kotlin.Int
|
||||
public final operator infix fun times(/*0*/ other: Example): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
open class Example {
|
||||
fun invoke() = 0
|
||||
fun get(i: Int) = 0
|
||||
|
||||
fun component1() = 0
|
||||
fun component2() = 0
|
||||
|
||||
fun inc() = Example()
|
||||
|
||||
fun plus(o: Example) = 0
|
||||
}
|
||||
|
||||
class Example2 : Example()
|
||||
|
||||
operator fun Example.invoke() = ""
|
||||
operator fun Example.get(i: Int) = ""
|
||||
|
||||
operator fun Example.component1() = ""
|
||||
operator fun Example.component2() = ""
|
||||
|
||||
operator fun Example.inc() = Example2()
|
||||
|
||||
infix fun Example.plus(o: Example) = ""
|
||||
|
||||
fun a() {
|
||||
var a = Example()
|
||||
val b = Example()
|
||||
|
||||
consumeString(a())
|
||||
consumeString(a[1])
|
||||
|
||||
val (x, y) = Example()
|
||||
consumeString(x)
|
||||
consumeString(y)
|
||||
|
||||
consumeExample2(++a)
|
||||
|
||||
consumeString(a plus b)
|
||||
}
|
||||
|
||||
fun consumeInt(i: Int) {}
|
||||
fun consumeString(s: String) {}
|
||||
fun consumeExample2(e: Example2) {}
|
||||
@@ -0,0 +1,38 @@
|
||||
package
|
||||
|
||||
public fun a(): kotlin.Unit
|
||||
public fun consumeExample2(/*0*/ e: Example2): kotlin.Unit
|
||||
public fun consumeInt(/*0*/ i: kotlin.Int): kotlin.Unit
|
||||
public fun consumeString(/*0*/ s: kotlin.String): kotlin.Unit
|
||||
public operator fun Example.component1(): kotlin.String
|
||||
public operator fun Example.component2(): kotlin.String
|
||||
public operator fun Example.get(/*0*/ i: kotlin.Int): kotlin.String
|
||||
public operator fun Example.inc(): Example2
|
||||
public operator fun Example.invoke(): kotlin.String
|
||||
public infix fun Example.plus(/*0*/ o: Example): kotlin.String
|
||||
|
||||
public open class Example {
|
||||
public constructor Example()
|
||||
public final fun component1(): kotlin.Int
|
||||
public final fun component2(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final fun get(/*0*/ i: kotlin.Int): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public final fun inc(): Example
|
||||
public final fun invoke(): kotlin.Int
|
||||
public final fun plus(/*0*/ o: Example): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class Example2 : Example {
|
||||
public constructor Example2()
|
||||
public final override /*1*/ /*fake_override*/ fun component1(): kotlin.Int
|
||||
public final override /*1*/ /*fake_override*/ fun component2(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final override /*1*/ /*fake_override*/ fun get(/*0*/ i: kotlin.Int): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public final override /*1*/ /*fake_override*/ fun inc(): Example
|
||||
public final override /*1*/ /*fake_override*/ fun invoke(): kotlin.Int
|
||||
public final override /*1*/ /*fake_override*/ fun plus(/*0*/ o: Example): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
Reference in New Issue
Block a user