Prohibit renaming operator to another operator on import.

This commit is contained in:
Dmitry Petrov
2017-01-19 13:51:15 +03:00
parent 9625c32527
commit 03a697a707
6 changed files with 57 additions and 4 deletions
@@ -0,0 +1,16 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
// FILE: a.kt
package a
interface A
operator fun A.plus(other: A): A = this
// FILE: b.kt
package b
import a.A
import a.<!OPERATOR_RENAMED_ON_IMPORT!>plus<!> as minus
fun test(a1: A, a2: A) =
a1 - a2
@@ -0,0 +1,15 @@
package
package a {
public operator fun a.A.plus(/*0*/ other: a.A): a.A
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
}
}
package b {
public fun test(/*0*/ a1: a.A, /*1*/ a2: a.A): a.A
}