[K2] Do not report CONFLICTING_OVERLOADS for hidden callables.
This makes sense as such callables do not conflict on their use-sites, because a hidden callable loses to a non-hidden one when doing overload resolution. We achieve this by not considering such callables as conflicting when collecting them in FirDeclarationCollector. A callable is hidden if it will be hidden from the overload resolution, meaning it has a `Deprecated` or `DeprecatedSinceKotlin` annotation. NB: this also impacts `REDECLARATION` diagnostic for properties, as they can also be marked as `Deprecated`. NB: this change ignores local callables, as they are ignored w.r.t. `Deprecated` in K2. ^KT-22004 Fixed
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
// ISSUE: KT-22004
|
||||
|
||||
class A() {
|
||||
fun b() {
|
||||
}
|
||||
|
||||
@Deprecated("test", level = DeprecationLevel.HIDDEN)
|
||||
fun b() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// ISSUE: KT-22004
|
||||
|
||||
class A() {
|
||||
<!CONFLICTING_OVERLOADS!>fun b()<!> {
|
||||
}
|
||||
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("test", level = DeprecationLevel.HIDDEN)
|
||||
fun b()<!> {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// ISSUE: KT-61168
|
||||
|
||||
class A() {
|
||||
}
|
||||
|
||||
@Deprecated("A", level = DeprecationLevel.HIDDEN)
|
||||
fun A() = A()
|
||||
@@ -0,0 +1,7 @@
|
||||
// ISSUE: KT-61168
|
||||
|
||||
class A<!CONFLICTING_OVERLOADS!>()<!> {
|
||||
}
|
||||
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("A", level = DeprecationLevel.HIDDEN)
|
||||
fun A()<!> = A()
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
class A {
|
||||
fun a(a: Int): Int = 0
|
||||
|
||||
@Deprecated("a", level = DeprecationLevel.HIDDEN)
|
||||
fun a(a: Int) {
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
class A {
|
||||
<!CONFLICTING_OVERLOADS!>fun a(a: Int): Int<!> = 0
|
||||
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("a", level = DeprecationLevel.HIDDEN)
|
||||
fun a(a: Int)<!> {
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package qwertyuiop
|
||||
|
||||
fun c(s: String) {
|
||||
}
|
||||
|
||||
@Deprecated("c", level = DeprecationLevel.HIDDEN)
|
||||
fun c(s: String) {
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package qwertyuiop
|
||||
|
||||
<!CONFLICTING_OVERLOADS!>fun c(s: String)<!> {
|
||||
}
|
||||
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("c", level = DeprecationLevel.HIDDEN)
|
||||
fun c(s: String)<!> {
|
||||
}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
fun <T1> test1(x: List<T1>) = x
|
||||
@Deprecated("test1", level = DeprecationLevel.HIDDEN)
|
||||
fun <T2> test1(x: List<T2>) = x
|
||||
|
||||
fun <T1> List<T1>.test1a() {}
|
||||
@Deprecated("test2", level = DeprecationLevel.HIDDEN)
|
||||
fun <T2> List<T2>.test1a() {}
|
||||
|
||||
fun <T> test2(x: List<T>) = x
|
||||
fun test2(x: List<String>) = x
|
||||
|
||||
fun <T> List<T>.test2a() {}
|
||||
fun List<String>.test2a() {}
|
||||
|
||||
fun <T : Any> test3(x: List<T>) = x
|
||||
fun test3(x: List<Any>) = x
|
||||
|
||||
fun <T : Any> List<T>.test3a() {}
|
||||
fun List<Any>.test3a() {}
|
||||
|
||||
fun <T> test4(x: Map<T, T>) = x
|
||||
fun <K, V> test4(x: Map<K, V>) = x
|
||||
|
||||
fun <T> Map<T, T>.test4a() {}
|
||||
fun <K, V> Map<K, V>.test4a() {}
|
||||
|
||||
class Inv<T>
|
||||
|
||||
fun <T> test5(x: Inv<T>) = x
|
||||
@Deprecated("test5", level = DeprecationLevel.HIDDEN)
|
||||
fun <T> test5(x: Inv<out T>) = x
|
||||
|
||||
fun <T> test6(x: Array<T>) = x
|
||||
fun test6(x: Array<String>) = x
|
||||
|
||||
fun <T> test7(x: Inv<T>) = x
|
||||
fun <T> Inv<T>.test7() {}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
<!CONFLICTING_OVERLOADS!>fun <T1> test1(x: List<T1>)<!> = x
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("test1", level = DeprecationLevel.HIDDEN)
|
||||
fun <T2> test1(x: List<T2>)<!> = x
|
||||
|
||||
<!CONFLICTING_OVERLOADS!>fun <T1> List<T1>.test1a()<!> {}
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("test2", level = DeprecationLevel.HIDDEN)
|
||||
fun <T2> List<T2>.test1a()<!> {}
|
||||
|
||||
<!CONFLICTING_JVM_DECLARATIONS!>fun <T> test2(x: List<T>)<!> = x
|
||||
<!CONFLICTING_JVM_DECLARATIONS!>fun test2(x: List<String>)<!> = x
|
||||
|
||||
<!CONFLICTING_JVM_DECLARATIONS!>fun <T> List<T>.test2a()<!> {}
|
||||
<!CONFLICTING_JVM_DECLARATIONS!>fun List<String>.test2a()<!> {}
|
||||
|
||||
<!CONFLICTING_JVM_DECLARATIONS!>fun <T : Any> test3(x: List<T>)<!> = x
|
||||
<!CONFLICTING_JVM_DECLARATIONS!>fun test3(x: List<Any>)<!> = x
|
||||
|
||||
<!CONFLICTING_JVM_DECLARATIONS!>fun <T : Any> List<T>.test3a()<!> {}
|
||||
<!CONFLICTING_JVM_DECLARATIONS!>fun List<Any>.test3a()<!> {}
|
||||
|
||||
<!CONFLICTING_JVM_DECLARATIONS!>fun <T> test4(x: Map<T, T>)<!> = x
|
||||
<!CONFLICTING_JVM_DECLARATIONS!>fun <K, V> test4(x: Map<K, V>)<!> = x
|
||||
|
||||
<!CONFLICTING_JVM_DECLARATIONS!>fun <T> Map<T, T>.test4a()<!> {}
|
||||
<!CONFLICTING_JVM_DECLARATIONS!>fun <K, V> Map<K, V>.test4a()<!> {}
|
||||
|
||||
class Inv<T>
|
||||
|
||||
<!CONFLICTING_OVERLOADS!>fun <T> test5(x: Inv<T>)<!> = x
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("test5", level = DeprecationLevel.HIDDEN)
|
||||
fun <T> test5(x: Inv<out T>)<!> = x
|
||||
|
||||
fun <T> test6(x: Array<T>) = x
|
||||
fun test6(x: Array<String>) = x
|
||||
|
||||
fun <T> test7(x: Inv<T>) = x
|
||||
fun <T> Inv<T>.test7() {}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
package extensionFunctions
|
||||
|
||||
fun Int.qwe(a: Float) = 1
|
||||
|
||||
@Deprecated("qwe", level = DeprecationLevel.HIDDEN)
|
||||
fun Int.qwe(a: Float) = 2
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
package extensionFunctions
|
||||
|
||||
<!CONFLICTING_OVERLOADS!>fun Int.qwe(a: Float)<!> = 1
|
||||
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("qwe", level = DeprecationLevel.HIDDEN)
|
||||
fun Int.qwe(a: Float)<!> = 2
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
class A() {
|
||||
fun b() {
|
||||
}
|
||||
|
||||
@Deprecated("b", level = DeprecationLevel.HIDDEN)
|
||||
fun b() {
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
class A() {
|
||||
<!CONFLICTING_OVERLOADS!>fun b()<!> {
|
||||
}
|
||||
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("b", level = DeprecationLevel.HIDDEN)
|
||||
fun b()<!> {
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class Aaa() {
|
||||
val a = 1
|
||||
@Deprecated("a", level = DeprecationLevel.HIDDEN)
|
||||
val a = 1
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class Aaa() {
|
||||
val <!REDECLARATION!>a<!> = 1
|
||||
@Deprecated("a", level = DeprecationLevel.HIDDEN)
|
||||
val <!REDECLARATION!>a<!> = 1
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class Aaa() {
|
||||
val a = 1
|
||||
@Deprecated("a", level = DeprecationLevel.HIDDEN)
|
||||
val a = ""
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class Aaa() {
|
||||
val <!REDECLARATION!>a<!> = 1
|
||||
@Deprecated("a", level = DeprecationLevel.HIDDEN)
|
||||
val <!REDECLARATION!>a<!> = ""
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
// constructor vs. fun overload
|
||||
|
||||
// FILE: J.java
|
||||
package constructorVsFun;
|
||||
|
||||
public class J {
|
||||
public J(String s) {}
|
||||
}
|
||||
|
||||
// FILE: G.java
|
||||
package constructorVsFun;
|
||||
|
||||
public class G {
|
||||
@kotlin.Deprecated("G", level = DeprecationLevel.HIDDEN)
|
||||
public G(String s) {}
|
||||
}
|
||||
|
||||
// FILE: test.kt
|
||||
package constructorVsFun
|
||||
|
||||
class a() { }
|
||||
|
||||
@Deprecated("a", level = DeprecationLevel.HIDDEN)
|
||||
fun a() = 1
|
||||
|
||||
class b @Deprecated("b", level = DeprecationLevel.HIDDEN) constructor() { }
|
||||
|
||||
fun b() = 2
|
||||
|
||||
class Tram {
|
||||
@Deprecated("f", level = DeprecationLevel.HIDDEN)
|
||||
fun f() { }
|
||||
|
||||
class f() { }
|
||||
}
|
||||
|
||||
class Yvayva {
|
||||
companion object {
|
||||
@Deprecated("fghj", level = DeprecationLevel.HIDDEN)
|
||||
fun fghj() { }
|
||||
|
||||
class fghj() { }
|
||||
}
|
||||
}
|
||||
|
||||
class Rtyu {
|
||||
fun ololo() { }
|
||||
|
||||
companion object {
|
||||
class ololo() { }
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated("J", level = DeprecationLevel.HIDDEN)
|
||||
fun J(s: String) { }
|
||||
|
||||
fun G(s: String) { }
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
// constructor vs. fun overload
|
||||
|
||||
// FILE: J.java
|
||||
package constructorVsFun;
|
||||
|
||||
public class J {
|
||||
public J(String s) {}
|
||||
}
|
||||
|
||||
// FILE: G.java
|
||||
package constructorVsFun;
|
||||
|
||||
public class G {
|
||||
@kotlin.Deprecated("G", level = DeprecationLevel.HIDDEN)
|
||||
public G(String s) {}
|
||||
}
|
||||
|
||||
// FILE: test.kt
|
||||
package constructorVsFun
|
||||
|
||||
class a<!CONFLICTING_OVERLOADS!>()<!> { }
|
||||
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("a", level = DeprecationLevel.HIDDEN)
|
||||
fun a()<!> = 1
|
||||
|
||||
class b @Deprecated("b", level = DeprecationLevel.HIDDEN) <!CONFLICTING_OVERLOADS!>constructor()<!> { }
|
||||
|
||||
<!CONFLICTING_OVERLOADS!>fun b()<!> = 2
|
||||
|
||||
class Tram {
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("f", level = DeprecationLevel.HIDDEN)
|
||||
fun f()<!> { }
|
||||
|
||||
class f<!CONFLICTING_OVERLOADS!>()<!> { }
|
||||
}
|
||||
|
||||
class Yvayva {
|
||||
companion object {
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("fghj", level = DeprecationLevel.HIDDEN)
|
||||
fun fghj()<!> { }
|
||||
|
||||
class fghj<!CONFLICTING_OVERLOADS!>()<!> { }
|
||||
}
|
||||
}
|
||||
|
||||
class Rtyu {
|
||||
fun ololo() { }
|
||||
|
||||
companion object {
|
||||
class ololo() { }
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated("J", level = DeprecationLevel.HIDDEN)
|
||||
fun J(s: String) { }
|
||||
|
||||
fun G(s: String) { }
|
||||
Vendored
+265
@@ -0,0 +1,265 @@
|
||||
// FIR_IDENTICAL
|
||||
|
||||
fun test() {
|
||||
<!CONFLICTING_OVERLOADS!>fun test1()<!> {}
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("test1", level = DeprecationLevel.HIDDEN)
|
||||
fun test1()<!> {}
|
||||
|
||||
fun Any.test2() {}
|
||||
fun test2(x: Any) = x
|
||||
|
||||
<!CONFLICTING_OVERLOADS!>fun Any.test3()<!> {}
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("test3", level = DeprecationLevel.HIDDEN)
|
||||
fun Any.test3()<!> {}
|
||||
|
||||
<!CONFLICTING_OVERLOADS!>fun test4(): Int<!> = 0
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("test4", level = DeprecationLevel.HIDDEN)
|
||||
fun test4(): String<!> = ""
|
||||
|
||||
class Test5<!CONFLICTING_OVERLOADS!>(val x: Int)<!> {
|
||||
<!CONFLICTING_OVERLOADS!>constructor()<!>: this(0)
|
||||
}
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("Test5", level = DeprecationLevel.HIDDEN)
|
||||
fun Test5()<!> {}
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("Test5", level = DeprecationLevel.HIDDEN)
|
||||
fun Test5(x: Int)<!> = x
|
||||
|
||||
fun local() {
|
||||
<!CONFLICTING_OVERLOADS!>fun test1()<!> {}
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("test1", level = DeprecationLevel.HIDDEN)
|
||||
fun test1()<!> {}
|
||||
|
||||
fun Any.test2() {}
|
||||
fun test2(x: Any) = x
|
||||
|
||||
<!CONFLICTING_OVERLOADS!>fun Any.test3()<!> {}
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("test3", level = DeprecationLevel.HIDDEN)
|
||||
fun Any.test3()<!> {}
|
||||
|
||||
<!CONFLICTING_OVERLOADS!>fun test4(): Int<!> = 0
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("test4", level = DeprecationLevel.HIDDEN)
|
||||
fun test4(): String<!> = ""
|
||||
|
||||
class Test5<!CONFLICTING_OVERLOADS!>(val x: Int)<!> {
|
||||
<!CONFLICTING_OVERLOADS!>constructor()<!>: this(0)
|
||||
}
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("Test5", level = DeprecationLevel.HIDDEN)
|
||||
fun Test5()<!> {}
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("Test5", level = DeprecationLevel.HIDDEN)
|
||||
fun Test5(x: Int)<!> = x
|
||||
}
|
||||
}
|
||||
|
||||
class Test {
|
||||
init {
|
||||
<!CONFLICTING_OVERLOADS!>fun test1()<!> {}
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("test1", level = DeprecationLevel.HIDDEN)
|
||||
fun test1()<!> {}
|
||||
|
||||
fun Any.test2() {}
|
||||
fun test2(x: Any) = x
|
||||
|
||||
<!CONFLICTING_OVERLOADS!>fun Any.test3()<!> {}
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("test3", level = DeprecationLevel.HIDDEN)
|
||||
fun Any.test3()<!> {}
|
||||
|
||||
<!CONFLICTING_OVERLOADS!>fun test4(): Int<!> = 0
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("test4", level = DeprecationLevel.HIDDEN)
|
||||
fun test4(): String<!> = ""
|
||||
|
||||
class Test5<!CONFLICTING_OVERLOADS!>(val x: Int)<!> {
|
||||
<!CONFLICTING_OVERLOADS!>constructor()<!>: this(0)
|
||||
}
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("Test5", level = DeprecationLevel.HIDDEN)
|
||||
fun Test5()<!> {}
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("Test5", level = DeprecationLevel.HIDDEN)
|
||||
fun Test5(x: Int)<!> = x
|
||||
}
|
||||
|
||||
fun test() {
|
||||
<!CONFLICTING_OVERLOADS!>fun test1()<!> {}
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("test1", level = DeprecationLevel.HIDDEN)
|
||||
fun test1()<!> {}
|
||||
|
||||
fun Any.test2() {}
|
||||
fun test2(x: Any) = x
|
||||
|
||||
<!CONFLICTING_OVERLOADS!>fun Any.test3()<!> {}
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("test3", level = DeprecationLevel.HIDDEN)
|
||||
fun Any.test3()<!> {}
|
||||
|
||||
<!CONFLICTING_OVERLOADS!>fun test4(): Int<!> = 0
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("test4", level = DeprecationLevel.HIDDEN)
|
||||
fun test4(): String<!> = ""
|
||||
|
||||
class Test5<!CONFLICTING_OVERLOADS!>(val x: Int)<!> {
|
||||
<!CONFLICTING_OVERLOADS!>constructor()<!>: this(0)
|
||||
}
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("Test5", level = DeprecationLevel.HIDDEN)
|
||||
fun Test5()<!> {}
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("Test5", level = DeprecationLevel.HIDDEN)
|
||||
fun Test5(x: Int)<!> = x
|
||||
}
|
||||
|
||||
val property: Any get() {
|
||||
<!CONFLICTING_OVERLOADS!>fun test1()<!> {}
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("test1", level = DeprecationLevel.HIDDEN)
|
||||
fun test1()<!> {}
|
||||
|
||||
fun Any.test2() {}
|
||||
fun test2(x: Any) = x
|
||||
|
||||
<!CONFLICTING_OVERLOADS!>fun Any.test3()<!> {}
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("test3", level = DeprecationLevel.HIDDEN)
|
||||
fun Any.test3()<!> {}
|
||||
|
||||
<!CONFLICTING_OVERLOADS!>fun test4(): Int<!> = 0
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("test4", level = DeprecationLevel.HIDDEN)
|
||||
fun test4(): String<!> = ""
|
||||
|
||||
class Test5<!CONFLICTING_OVERLOADS!>(val x: Int)<!> {
|
||||
<!CONFLICTING_OVERLOADS!>constructor()<!>: this(0)
|
||||
}
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("Test5", level = DeprecationLevel.HIDDEN)
|
||||
fun Test5()<!> {}
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("Test5", level = DeprecationLevel.HIDDEN)
|
||||
fun Test5(x: Int)<!> = x
|
||||
|
||||
return 0
|
||||
}
|
||||
}
|
||||
|
||||
val property: Any get() {
|
||||
<!CONFLICTING_OVERLOADS!>fun test1()<!> {}
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("test1", level = DeprecationLevel.HIDDEN)
|
||||
fun test1()<!> {}
|
||||
|
||||
fun Any.test2() {}
|
||||
fun test2(x: Any) = x
|
||||
|
||||
<!CONFLICTING_OVERLOADS!>fun Any.test3()<!> {}
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("test3", level = DeprecationLevel.HIDDEN)
|
||||
fun Any.test3()<!> {}
|
||||
|
||||
<!CONFLICTING_OVERLOADS!>fun test4(): Int<!> = 0
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("test4", level = DeprecationLevel.HIDDEN)
|
||||
fun test4(): String<!> = ""
|
||||
|
||||
class Test5<!CONFLICTING_OVERLOADS!>(val x: Int)<!> {
|
||||
<!CONFLICTING_OVERLOADS!>constructor()<!>: this(0)
|
||||
}
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("Test5", level = DeprecationLevel.HIDDEN)
|
||||
fun Test5()<!> {}
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("Test5", level = DeprecationLevel.HIDDEN)
|
||||
fun Test5(x: Int)<!> = x
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
object Object {
|
||||
fun test() {
|
||||
<!CONFLICTING_OVERLOADS!>fun test1()<!> {}
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("test1", level = DeprecationLevel.HIDDEN)
|
||||
fun test1()<!> {}
|
||||
|
||||
fun Any.test2() {}
|
||||
fun test2(x: Any) = x
|
||||
|
||||
<!CONFLICTING_OVERLOADS!>fun Any.test3()<!> {}
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("test3", level = DeprecationLevel.HIDDEN)
|
||||
fun Any.test3()<!> {}
|
||||
|
||||
<!CONFLICTING_OVERLOADS!>fun test4(): Int<!> = 0
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("test4", level = DeprecationLevel.HIDDEN)
|
||||
fun test4(): String<!> = ""
|
||||
|
||||
class Test5<!CONFLICTING_OVERLOADS!>(val x: Int)<!> {
|
||||
<!CONFLICTING_OVERLOADS!>constructor()<!>: this(0)
|
||||
}
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("Test5", level = DeprecationLevel.HIDDEN)
|
||||
fun Test5()<!> {}
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("Test5", level = DeprecationLevel.HIDDEN)
|
||||
fun Test5(x: Int)<!> = x
|
||||
}
|
||||
|
||||
val property: Any get() {
|
||||
<!CONFLICTING_OVERLOADS!>fun test1()<!> {}
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("test1", level = DeprecationLevel.HIDDEN)
|
||||
fun test1()<!> {}
|
||||
|
||||
fun Any.test2() {}
|
||||
fun test2(x: Any) = x
|
||||
|
||||
<!CONFLICTING_OVERLOADS!>fun Any.test3()<!> {}
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("test3", level = DeprecationLevel.HIDDEN)
|
||||
fun Any.test3()<!> {}
|
||||
|
||||
<!CONFLICTING_OVERLOADS!>fun test4(): Int<!> = 0
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("test4", level = DeprecationLevel.HIDDEN)
|
||||
fun test4(): String<!> = ""
|
||||
|
||||
class Test5<!CONFLICTING_OVERLOADS!>(val x: Int)<!> {
|
||||
<!CONFLICTING_OVERLOADS!>constructor()<!>: this(0)
|
||||
}
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("Test5", level = DeprecationLevel.HIDDEN)
|
||||
fun Test5()<!> {}
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("Test5", level = DeprecationLevel.HIDDEN)
|
||||
fun Test5(x: Int)<!> = x
|
||||
|
||||
return 0
|
||||
}
|
||||
}
|
||||
|
||||
val obj = object {
|
||||
fun test() {
|
||||
<!CONFLICTING_OVERLOADS!>fun test1()<!> {}
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("test1", level = DeprecationLevel.HIDDEN)
|
||||
fun test1()<!> {}
|
||||
|
||||
fun Any.test2() {}
|
||||
fun test2(x: Any) = x
|
||||
|
||||
<!CONFLICTING_OVERLOADS!>fun Any.test3()<!> {}
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("test3", level = DeprecationLevel.HIDDEN)
|
||||
fun Any.test3()<!> {}
|
||||
|
||||
<!CONFLICTING_OVERLOADS!>fun test4(): Int<!> = 0
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("test4", level = DeprecationLevel.HIDDEN)
|
||||
fun test4(): String<!> = ""
|
||||
|
||||
class Test5<!CONFLICTING_OVERLOADS!>(val x: Int)<!> {
|
||||
<!CONFLICTING_OVERLOADS!>constructor()<!>: this(0)
|
||||
}
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("Test5", level = DeprecationLevel.HIDDEN)
|
||||
fun Test5()<!> {}
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("Test5", level = DeprecationLevel.HIDDEN)
|
||||
fun Test5(x: Int)<!> = x
|
||||
}
|
||||
|
||||
val property: Any get() {
|
||||
<!CONFLICTING_OVERLOADS!>fun test1()<!> {}
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("test1", level = DeprecationLevel.HIDDEN)
|
||||
fun test1()<!> {}
|
||||
|
||||
fun Any.test2() {}
|
||||
fun test2(x: Any) = x
|
||||
|
||||
<!CONFLICTING_OVERLOADS!>fun Any.test3()<!> {}
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("test3", level = DeprecationLevel.HIDDEN)
|
||||
fun Any.test3()<!> {}
|
||||
|
||||
<!CONFLICTING_OVERLOADS!>fun test4(): Int<!> = 0
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("test4", level = DeprecationLevel.HIDDEN)
|
||||
fun test4(): String<!> = ""
|
||||
|
||||
class Test5<!CONFLICTING_OVERLOADS!>(val x: Int)<!> {
|
||||
<!CONFLICTING_OVERLOADS!>constructor()<!>: this(0)
|
||||
}
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("Test5", level = DeprecationLevel.HIDDEN)
|
||||
fun Test5()<!> {}
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("Test5", level = DeprecationLevel.HIDDEN)
|
||||
fun Test5(x: Int)<!> = x
|
||||
|
||||
return 0
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
import java.io.Serializable
|
||||
|
||||
interface Test1 {
|
||||
fun <T> foo(t: T) where T : Cloneable, T : Serializable
|
||||
@Deprecated("foo", level = DeprecationLevel.HIDDEN)
|
||||
fun <T> foo(t: T) where T : Serializable, T : Cloneable
|
||||
}
|
||||
|
||||
|
||||
interface I1
|
||||
interface I2 : I1
|
||||
|
||||
interface Test2 {
|
||||
fun <T> foo(t: T) where T : I1, T : I2
|
||||
@Deprecated("foo", level = DeprecationLevel.HIDDEN)
|
||||
fun <T> foo(t: T) where T : I2, T : I1
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
import java.io.Serializable
|
||||
|
||||
interface Test1 {
|
||||
<!CONFLICTING_OVERLOADS!>fun <T> foo(t: T)<!> where T : Cloneable, T : Serializable
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("foo", level = DeprecationLevel.HIDDEN)
|
||||
fun <T> foo(t: T)<!> where T : Serializable, T : Cloneable
|
||||
}
|
||||
|
||||
|
||||
interface I1
|
||||
interface I2 : I1
|
||||
|
||||
interface Test2 {
|
||||
<!CONFLICTING_OVERLOADS!>fun <T> foo(t: T)<!> where T : I1, T : I2
|
||||
<!CONFLICTING_OVERLOADS!>@Deprecated("foo", level = DeprecationLevel.HIDDEN)
|
||||
fun <T> foo(t: T)<!> where T : I2, T : I1
|
||||
}
|
||||
Reference in New Issue
Block a user