239502368a
- locals win - unary calls to plus/minus are not supported in favor of unaryPlus/unaryMinus - unqualified nested classes are temporarily reported as unresolved - function without receiver win against extension function - explicit import win against star import
41 lines
992 B
Kotlin
Vendored
41 lines
992 B
Kotlin
Vendored
// !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 * b
|
|
a <!OPERATOR_MODIFIER_REQUIRED!>/<!> b
|
|
|
|
a times b
|
|
a <!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) {} |