[FIR] Partial implementation of DEPRECATION(_ERROR) diagnostics
No support for inheritance deprecations and deprecations in qualifier's parts
This commit is contained in:
committed by
teamcityserver
parent
9fad55d551
commit
de3f31cf78
+1
-1
@@ -9,7 +9,7 @@ package foo
|
||||
|
||||
fun f() {
|
||||
class Local1 {
|
||||
fun g() : <!UNRESOLVED_REFERENCE!>bar.X?<!> = null
|
||||
fun g() : <!UNRESOLVED_REFERENCE!>bar.X<!>? = null
|
||||
}
|
||||
class Local2 {
|
||||
fun g() : foo.bar.X? = null
|
||||
|
||||
@@ -5,8 +5,8 @@ package foobar.a
|
||||
import java.*
|
||||
|
||||
val a : java.util.List<Int>? = null
|
||||
val a2 : <!UNRESOLVED_REFERENCE!>util.List<Int>?<!> = null
|
||||
val a3 : <!UNRESOLVED_REFERENCE!>LinkedList<Int>?<!> = null
|
||||
val a2 : <!UNRESOLVED_REFERENCE!>util.List<Int><!>? = null
|
||||
val a3 : <!UNRESOLVED_REFERENCE!>LinkedList<Int><!>? = null
|
||||
|
||||
// FILE: b.kt
|
||||
package foobar
|
||||
@@ -20,7 +20,7 @@ package foobar.a
|
||||
import java.util.*
|
||||
|
||||
val b : List<Int>? = <!INITIALIZER_TYPE_MISMATCH!>a<!>
|
||||
val b1 : <!UNRESOLVED_REFERENCE!>util.List<Int>?<!> = a
|
||||
val b1 : <!UNRESOLVED_REFERENCE!>util.List<Int><!>? = a
|
||||
|
||||
// FILE: d.kt
|
||||
package foobar
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
@Deprecated("text")
|
||||
annotation class obsolete()
|
||||
|
||||
@Deprecated("text")
|
||||
annotation class obsoleteWithParam(val text: String)
|
||||
|
||||
@obsolete class Obsolete
|
||||
|
||||
@obsoleteWithParam("text") class Obsolete2
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
@Deprecated("text")
|
||||
annotation class obsolete()
|
||||
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
// FILE: A.kt
|
||||
class A(s: String) {
|
||||
@Deprecated("")
|
||||
constructor(i: Int) : this(i.toString()) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: B.java
|
||||
public class B extends A {
|
||||
@Deprecated
|
||||
public B(int i) {
|
||||
|
||||
}
|
||||
|
||||
public B(String s) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: C.kt
|
||||
class C @Deprecated("") constructor(s: String) {
|
||||
}
|
||||
|
||||
// FILE: use.kt
|
||||
fun use(a: A, b: B, c: C) {
|
||||
A(3)
|
||||
A("")
|
||||
B(3)
|
||||
B("")
|
||||
C("s")
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
// FILE: A.kt
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
@Deprecated("alas", level = DeprecationLevel.ERROR)
|
||||
fun foo() {}
|
||||
|
||||
@Deprecated("alas", level = DeprecationLevel.ERROR)
|
||||
class C
|
||||
|
||||
fun test(c: C) {
|
||||
foo()
|
||||
C()
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
@Deprecated("alas", level = DeprecationLevel.ERROR)
|
||||
fun foo() {}
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
class Table
|
||||
class Tr
|
||||
|
||||
fun table(body: Table.() -> Unit) {}
|
||||
fun Table.tr(body: Tr.() -> Unit) {}
|
||||
@Deprecated("Don't call me", level = DeprecationLevel.ERROR)
|
||||
fun Tr.tr(body: Tr.() -> Unit) {}
|
||||
|
||||
fun builderTest() {
|
||||
table {
|
||||
tr {
|
||||
tr {}
|
||||
table {
|
||||
tr {
|
||||
tr {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
class Table
|
||||
class Tr
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
|
||||
@Deprecated("", level = DeprecationLevel.HIDDEN)
|
||||
open class Foo
|
||||
|
||||
fun test(f: Foo) {
|
||||
f.toString()
|
||||
val g: Foo? = Foo()
|
||||
}
|
||||
|
||||
class Bar : Foo()
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
|
||||
@Deprecated("", level = DeprecationLevel.HIDDEN)
|
||||
|
||||
Vendored
-23
@@ -1,23 +0,0 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION
|
||||
|
||||
object Scope {
|
||||
fun foo(): Int = 0
|
||||
|
||||
object Nested {
|
||||
@Deprecated("err", level = DeprecationLevel.HIDDEN)
|
||||
fun foo(): String = ""
|
||||
|
||||
fun <T> take(f: () -> T): T = f()
|
||||
|
||||
fun test() {
|
||||
val r1 = take(::foo)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>r1<!>
|
||||
|
||||
val r2 = ::foo
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.reflect.KFunction0<kotlin.String>")!>r2<!>
|
||||
|
||||
val r3 = foo()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>r3<!>
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION
|
||||
|
||||
object Scope {
|
||||
|
||||
+7
-7
@@ -112,9 +112,9 @@ fun use(
|
||||
e2: E2, w2: W2, ew2: EW2, hew2: HEW2,
|
||||
explicitError: ExplicitError
|
||||
) {
|
||||
wd.f()
|
||||
ed.f()
|
||||
hd.f()
|
||||
wd.<!DEPRECATION!>f<!>()
|
||||
ed.<!DEPRECATION_ERROR!>f<!>()
|
||||
hd.<!INVISIBLE_REFERENCE!>f<!>()
|
||||
|
||||
we.f()
|
||||
wh.f()
|
||||
@@ -131,10 +131,10 @@ fun use(
|
||||
nwe2.f()
|
||||
nwe3.f()
|
||||
|
||||
e2.f()
|
||||
w2.f()
|
||||
e2.<!DEPRECATION_ERROR!>f<!>()
|
||||
w2.<!DEPRECATION!>f<!>()
|
||||
ew2.f()
|
||||
hew2.f()
|
||||
|
||||
explicitError.f()
|
||||
}
|
||||
explicitError.<!DEPRECATION_ERROR!>f<!>()
|
||||
}
|
||||
|
||||
+11
-11
@@ -94,20 +94,20 @@ fun use(
|
||||
sdh: SDH, edh: EDH, ned: NED,
|
||||
diff: Diff
|
||||
) {
|
||||
warningDeprecated.p
|
||||
warningDeprecated.p = 1
|
||||
warningDeprecated.<!DEPRECATION!>p<!>
|
||||
warningDeprecated.p <!DEPRECATION!>=<!> 1
|
||||
|
||||
errorDeprecated.p
|
||||
errorDeprecated.p = 1
|
||||
errorDeprecated.<!DEPRECATION_ERROR!>p<!>
|
||||
errorDeprecated.p <!DEPRECATION_ERROR!>=<!> 1
|
||||
|
||||
getterDeprecated.p
|
||||
getterDeprecated.<!DEPRECATION!>p<!>
|
||||
getterDeprecated.p = 1
|
||||
|
||||
setterDeprecated.p
|
||||
setterDeprecated.p = 1
|
||||
setterDeprecated.p <!DEPRECATION!>=<!> 1
|
||||
|
||||
hiddenDeprecated.p
|
||||
hiddenDeprecated.p = 1
|
||||
hiddenDeprecated.<!INVISIBLE_REFERENCE!>p<!>
|
||||
hiddenDeprecated.<!INVISIBLE_REFERENCE!>p<!> = 1
|
||||
|
||||
wd.p
|
||||
wd.p = 1
|
||||
@@ -130,6 +130,6 @@ fun use(
|
||||
ned.p
|
||||
ned.p = 1
|
||||
|
||||
diff.p
|
||||
diff.p = 1
|
||||
}
|
||||
diff.<!DEPRECATION_ERROR!>p<!>
|
||||
diff.<!INVISIBLE_REFERENCE!>p<!> = 1
|
||||
}
|
||||
|
||||
-37
@@ -1,37 +0,0 @@
|
||||
// !API_VERSION: 1.4
|
||||
|
||||
package kotlin
|
||||
|
||||
@Deprecated("")
|
||||
@DeprecatedSinceKotlin(errorSince = "1.4")
|
||||
class ClassCur
|
||||
|
||||
@Deprecated("")
|
||||
@DeprecatedSinceKotlin(errorSince = "1.4")
|
||||
fun funCur() {}
|
||||
|
||||
@Deprecated("")
|
||||
@DeprecatedSinceKotlin(errorSince = "1.4")
|
||||
val valCur = Unit
|
||||
|
||||
@Deprecated("")
|
||||
@DeprecatedSinceKotlin(errorSince = "1.5")
|
||||
class ClassNext
|
||||
|
||||
@Deprecated("")
|
||||
@DeprecatedSinceKotlin(errorSince = "1.5")
|
||||
fun funNext() {}
|
||||
|
||||
@Deprecated("")
|
||||
@DeprecatedSinceKotlin(errorSince = "1.5")
|
||||
val valNext = Unit
|
||||
|
||||
fun usage() {
|
||||
ClassCur()
|
||||
funCur()
|
||||
valCur
|
||||
|
||||
ClassNext()
|
||||
funNext()
|
||||
valNext
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !API_VERSION: 1.4
|
||||
|
||||
package kotlin
|
||||
|
||||
+2
-2
@@ -27,9 +27,9 @@ fun funNext() {}
|
||||
val valNext = Unit
|
||||
|
||||
fun usage() {
|
||||
ClassCur()
|
||||
<!DEPRECATION_ERROR!>ClassCur<!>()
|
||||
<!INVISIBLE_REFERENCE!>funCur<!>()
|
||||
valCur
|
||||
<!INVISIBLE_REFERENCE!>valCur<!>
|
||||
|
||||
ClassNext()
|
||||
funNext()
|
||||
|
||||
+1
-1
@@ -5,5 +5,5 @@ package kotlin
|
||||
fun foo() {}
|
||||
|
||||
fun test() {
|
||||
foo()
|
||||
<!DEPRECATION!>foo<!>()
|
||||
}
|
||||
|
||||
-37
@@ -1,37 +0,0 @@
|
||||
// !API_VERSION: 1.4
|
||||
|
||||
package kotlin
|
||||
|
||||
@Deprecated("")
|
||||
@DeprecatedSinceKotlin(warningSince = "1.4")
|
||||
class ClassCur
|
||||
|
||||
@Deprecated("")
|
||||
@DeprecatedSinceKotlin(warningSince = "1.4")
|
||||
fun funCur() {}
|
||||
|
||||
@Deprecated("")
|
||||
@DeprecatedSinceKotlin(warningSince = "1.4")
|
||||
val valCur = Unit
|
||||
|
||||
@Deprecated("")
|
||||
@DeprecatedSinceKotlin(warningSince = "1.5")
|
||||
class ClassNext
|
||||
|
||||
@Deprecated("")
|
||||
@DeprecatedSinceKotlin(warningSince = "1.5")
|
||||
fun funNext() {}
|
||||
|
||||
@Deprecated("")
|
||||
@DeprecatedSinceKotlin(warningSince = "1.5")
|
||||
val valNext = Unit
|
||||
|
||||
fun usage() {
|
||||
ClassCur()
|
||||
funCur()
|
||||
valCur
|
||||
|
||||
ClassNext()
|
||||
funNext()
|
||||
valNext
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !API_VERSION: 1.4
|
||||
|
||||
package kotlin
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
class UsefulClass(val param: Int = 2) {
|
||||
operator fun getValue(instance: Any, property: KProperty<*>) : Int = 1
|
||||
operator fun setValue(instance: Any, property: KProperty<*>, value: Int) {}
|
||||
|
||||
@Deprecated("message")
|
||||
fun member() {}
|
||||
}
|
||||
|
||||
@Deprecated("message")
|
||||
fun Obsolete(param: Int = 1): UsefulClass = UsefulClass(param)
|
||||
|
||||
class Invocable {
|
||||
@Deprecated("message")
|
||||
operator fun invoke() {}
|
||||
}
|
||||
|
||||
object InvocableHolder {
|
||||
val invocable = Invocable()
|
||||
}
|
||||
|
||||
fun invoker() {
|
||||
val invocable = Invocable()
|
||||
invocable()
|
||||
InvocableHolder.invocable()
|
||||
}
|
||||
|
||||
fun block() {
|
||||
Obsolete()
|
||||
Obsolete(2)
|
||||
}
|
||||
|
||||
fun expression() = Obsolete()
|
||||
|
||||
fun reflection() = ::Obsolete
|
||||
fun reflection2() = UsefulClass::member
|
||||
|
||||
class Initializer {
|
||||
val x = Obsolete()
|
||||
}
|
||||
|
||||
@Deprecated("does nothing good")
|
||||
fun Any.doNothing() = this.toString() // "this" should not be marked as deprecated despite it referes to deprecated function
|
||||
|
||||
class Delegation {
|
||||
val x by Obsolete()
|
||||
var y by Obsolete()
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
+8
-8
@@ -27,14 +27,14 @@ var v6: String
|
||||
set(value) {}
|
||||
|
||||
fun test() {
|
||||
v1
|
||||
v2
|
||||
v3
|
||||
<!INVISIBLE_REFERENCE!>v1<!>
|
||||
<!INVISIBLE_REFERENCE!>v2<!>
|
||||
<!INVISIBLE_REFERENCE!>v3<!>
|
||||
v3 = ""
|
||||
v4
|
||||
v4 = ""
|
||||
v5
|
||||
v5 = ""
|
||||
v6
|
||||
v6 = ""
|
||||
<!INVISIBLE_REFERENCE!>v4<!> = ""
|
||||
<!INVISIBLE_REFERENCE!>v5<!>
|
||||
<!INVISIBLE_REFERENCE!>v5<!> = ""
|
||||
<!INVISIBLE_REFERENCE!>v6<!>
|
||||
<!INVISIBLE_REFERENCE!>v6<!> = ""
|
||||
}
|
||||
|
||||
@@ -5,4 +5,4 @@ class C {
|
||||
fun use() {}
|
||||
}
|
||||
|
||||
fun useAlias(c : C2) { c.use() }
|
||||
fun useAlias(c : <!DEPRECATION!>C2<!>) { c.use() }
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
// !DIAGNOSTICS: -NO_VALUE_FOR_PARAMETER
|
||||
// FILE: A.java
|
||||
|
||||
@Deprecated
|
||||
public class A {
|
||||
@Deprecated
|
||||
public String getFoo(String text) {
|
||||
return text;
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: B.kt
|
||||
|
||||
class B(private @property:Deprecated val foo: String) : A() {
|
||||
override fun getFoo(text: String): String = super.getFoo(text + foo)
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -NO_VALUE_FOR_PARAMETER
|
||||
// FILE: A.java
|
||||
|
||||
|
||||
-53
@@ -1,53 +0,0 @@
|
||||
// FILE: A.java
|
||||
|
||||
public class A {
|
||||
|
||||
@Deprecated
|
||||
public static final String D = "d";
|
||||
|
||||
@Deprecated
|
||||
public void f() {
|
||||
return text;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static void bar() {
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: B.java
|
||||
|
||||
public class B extends A {
|
||||
|
||||
public static final String D = "d";
|
||||
|
||||
@Override
|
||||
public void f() {
|
||||
return text;
|
||||
}
|
||||
|
||||
public static void bar() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// FILE: C.java
|
||||
|
||||
public class C extends A {
|
||||
}
|
||||
|
||||
// FILE: use.kt
|
||||
|
||||
fun use(a: A, b: B, c: C) {
|
||||
a.f()
|
||||
b.f()
|
||||
c.f()
|
||||
|
||||
A.D
|
||||
B.D
|
||||
C.D
|
||||
|
||||
A.bar()
|
||||
B.bar()
|
||||
C.bar()
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// FILE: A.java
|
||||
|
||||
public class A {
|
||||
|
||||
@@ -37,30 +37,30 @@ class PropertyHolder {
|
||||
}
|
||||
|
||||
fun PropertyHolder.extFunction() {
|
||||
test2 = "ext"
|
||||
test1
|
||||
test2 <!DEPRECATION!>=<!> "ext"
|
||||
<!DEPRECATION!>test1<!>
|
||||
}
|
||||
|
||||
fun fn() {
|
||||
PropertyHolder().test1
|
||||
PropertyHolder().test2
|
||||
PropertyHolder().test2 = ""
|
||||
PropertyHolder().<!DEPRECATION!>test1<!>
|
||||
PropertyHolder().<!DEPRECATION!>test2<!>
|
||||
PropertyHolder().test2 <!DEPRECATION!>=<!> ""
|
||||
|
||||
PropertyHolder().test3
|
||||
PropertyHolder().<!DEPRECATION!>test3<!>
|
||||
PropertyHolder().test3 = ""
|
||||
|
||||
PropertyHolder().test4
|
||||
PropertyHolder().test4 = ""
|
||||
PropertyHolder().test4 <!DEPRECATION!>=<!> ""
|
||||
|
||||
val a = PropertyHolder().x
|
||||
val b = PropertyHolder().name
|
||||
PropertyHolder().name = "value"
|
||||
val a = PropertyHolder().<!DEPRECATION!>x<!>
|
||||
val b = PropertyHolder().<!DEPRECATION!>name<!>
|
||||
PropertyHolder().name <!DEPRECATION!>=<!> "value"
|
||||
|
||||
val d = PropertyHolder().valDelegate
|
||||
PropertyHolder().varDelegate = 1
|
||||
}
|
||||
|
||||
fun literals() {
|
||||
PropertyHolder::test1
|
||||
PropertyHolder::name
|
||||
PropertyHolder::<!DEPRECATION!>test1<!>
|
||||
PropertyHolder::<!DEPRECATION!>name<!>
|
||||
}
|
||||
|
||||
+7
-7
@@ -17,15 +17,15 @@ class PropertyHolder {
|
||||
fun fn() {
|
||||
val holder = PropertyHolder()
|
||||
|
||||
holder.a1
|
||||
holder.a2
|
||||
holder.withGetter
|
||||
holder.withSetter = "A"
|
||||
holder.<!DEPRECATION!>a1<!>
|
||||
holder.<!DEPRECATION!>a2<!>
|
||||
holder.<!DEPRECATION!>withGetter<!>
|
||||
holder.withSetter <!DEPRECATION!>=<!> "A"
|
||||
}
|
||||
|
||||
fun literals() {
|
||||
PropertyHolder::a1
|
||||
PropertyHolder::a2
|
||||
PropertyHolder::withGetter
|
||||
PropertyHolder::<!DEPRECATION!>a1<!>
|
||||
PropertyHolder::<!DEPRECATION!>a2<!>
|
||||
PropertyHolder::<!DEPRECATION!>withGetter<!>
|
||||
PropertyHolder::withSetter
|
||||
}
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
@Deprecated("Class")
|
||||
open class Obsolete {
|
||||
fun use() {}
|
||||
}
|
||||
|
||||
@Deprecated("Class")
|
||||
open class Obsolete2 @Deprecated("Constructor") constructor() {
|
||||
fun use() {}
|
||||
}
|
||||
|
||||
interface Generic<T>
|
||||
|
||||
open class Derived() : Obsolete()
|
||||
|
||||
class Derived2() : Derived()
|
||||
|
||||
class TypeParam : Generic<Obsolete>
|
||||
|
||||
object Object : Obsolete()
|
||||
|
||||
class Properties {
|
||||
val x : Obsolete = Obsolete()
|
||||
var y : Obsolete = Obsolete()
|
||||
|
||||
var n : Obsolete
|
||||
get() = Obsolete()
|
||||
set(value) {}
|
||||
}
|
||||
|
||||
fun param(param: Obsolete) { param.use() }
|
||||
|
||||
fun funcParamReceiver(param: Obsolete.()->Unit) { Obsolete().param() }
|
||||
fun funcParamParam(param: (Obsolete)->Unit) { param(Obsolete()) }
|
||||
fun funcParamRetVal(param: ()->Obsolete) { param() }
|
||||
|
||||
fun <T: Obsolete> constraint() {}
|
||||
|
||||
fun Obsolete.receiver() {}
|
||||
|
||||
fun retVal(): Obsolete = Obsolete()
|
||||
|
||||
fun nullableRetVal(): Obsolete? = null
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
@Deprecated("Class")
|
||||
open class Obsolete {
|
||||
fun use() {}
|
||||
|
||||
@@ -6,9 +6,9 @@ open class WithDeprecatedCtor(val x: Int) {
|
||||
constructor() : this(0)
|
||||
}
|
||||
|
||||
typealias DeprecatedClassAlias = DeprecatedClass
|
||||
typealias DeprecatedClassAlias = <!DEPRECATION!>DeprecatedClass<!>
|
||||
typealias WithDeprecatedCtorAlias = WithDeprecatedCtor
|
||||
typealias ArrayListOfDeprecatedClass = ArrayList<DeprecatedClass>
|
||||
typealias ArrayListOfDeprecatedClass = ArrayList<<!DEPRECATION!>DeprecatedClass<!>>
|
||||
|
||||
class Test1 : DeprecatedClassAlias()
|
||||
|
||||
|
||||
+5
-5
@@ -4,12 +4,12 @@ class Foo
|
||||
@Deprecated("", level = DeprecationLevel.ERROR)
|
||||
class Err
|
||||
|
||||
typealias Test1 = Foo
|
||||
typealias Test2 = List<Foo>
|
||||
typealias Test1 = <!DEPRECATION!>Foo<!>
|
||||
typealias Test2 = List<<!DEPRECATION!>Foo<!>>
|
||||
typealias Test3 = List<Test2>
|
||||
|
||||
typealias TestErr1 = Err
|
||||
typealias TestErr2 = List<Err>
|
||||
typealias TestErr1 = <!DEPRECATION_ERROR!>Err<!>
|
||||
typealias TestErr2 = List<<!DEPRECATION_ERROR!>Err<!>>
|
||||
typealias TestErr3 = List<TestErr2>
|
||||
|
||||
fun use1(b: Test1) = b
|
||||
@@ -18,4 +18,4 @@ fun use3(b: Test3) = b
|
||||
|
||||
fun useErr1(b: TestErr1) = b
|
||||
fun useErr2(b: TestErr2) = b
|
||||
fun useErr3(b: TestErr3) = b
|
||||
fun useErr3(b: TestErr3) = b
|
||||
|
||||
@@ -11,14 +11,14 @@ typealias Obsolete = Base
|
||||
@Deprecated("Obsolete")
|
||||
typealias IObsolete = IFoo
|
||||
|
||||
fun test1(x: Obsolete) = x
|
||||
fun test1a(x: List<Obsolete>) = x
|
||||
fun test1(x: <!DEPRECATION!>Obsolete<!>) = x
|
||||
fun test1a(x: List<<!DEPRECATION!>Obsolete<!>>) = x
|
||||
|
||||
val test2 = Obsolete()
|
||||
|
||||
val test3 = Obsolete
|
||||
|
||||
class Test4: Obsolete()
|
||||
class Test4a: IObsolete
|
||||
class Test4b: IG<Obsolete>
|
||||
class Test4c: CG<Obsolete>()
|
||||
class Test4: <!DEPRECATION!>Obsolete<!>()
|
||||
class Test4a: <!DEPRECATION!>IObsolete<!>
|
||||
class Test4b: IG<<!DEPRECATION!>Obsolete<!>>
|
||||
class Test4c: CG<<!DEPRECATION!>Obsolete<!>>()
|
||||
|
||||
+2
-2
@@ -3,6 +3,6 @@
|
||||
@Deprecated("error", level = DeprecationLevel.ERROR)
|
||||
class Foo @Deprecated("warning", level = DeprecationLevel.WARNING) constructor()
|
||||
|
||||
fun test1() = Foo()
|
||||
fun test1() = <!DEPRECATION_ERROR!>Foo<!>()
|
||||
|
||||
fun test2(): Foo = Foo()
|
||||
fun test2(): <!DEPRECATION_ERROR!>Foo<!> = <!DEPRECATION_ERROR!>Foo<!>()
|
||||
|
||||
Vendored
+18
-18
@@ -1,6 +1,6 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// !LANGUAGE: +InlineClasses, -JvmInlineValueClasses
|
||||
// SKIP_JAVAC
|
||||
// ALLOW_KOTLIN_PACKAGE
|
||||
|
||||
// FILE: uint.kt
|
||||
|
||||
@@ -13,33 +13,33 @@ inline class ULong(private val l: Long)
|
||||
|
||||
// FILE: test.kt
|
||||
|
||||
annotation class AnnoUB(val ub0: <!UNRESOLVED_REFERENCE!>UByte<!>, val ub1: <!UNRESOLVED_REFERENCE!>UByte<!>)
|
||||
annotation class AnnoUS(val us0: <!UNRESOLVED_REFERENCE!>UShort<!>, val us1: <!UNRESOLVED_REFERENCE!>UShort<!>)
|
||||
annotation class AnnoUI(val ui0: <!UNRESOLVED_REFERENCE!>UInt<!>, val ui1: <!UNRESOLVED_REFERENCE!>UInt<!>, val ui2: <!UNRESOLVED_REFERENCE!>UInt<!>, val ui3: <!UNRESOLVED_REFERENCE!>UInt<!>)
|
||||
annotation class AnnoUL(val ul0: <!UNRESOLVED_REFERENCE!>ULong<!>, val ul1: <!UNRESOLVED_REFERENCE!>ULong<!>)
|
||||
annotation class AnnoUB(val ub0: UByte, val ub1: UByte)
|
||||
annotation class AnnoUS(val us0: UShort, val us1: UShort)
|
||||
annotation class AnnoUI(val ui0: UInt, val ui1: UInt, val ui2: UInt, val ui3: UInt)
|
||||
annotation class AnnoUL(val ul0: ULong, val ul1: ULong)
|
||||
|
||||
const val ub0 = <!UNRESOLVED_REFERENCE!>UByte<!>(1)
|
||||
const val us0 = <!UNRESOLVED_REFERENCE!>UShort<!>(2)
|
||||
const val ul0 = <!UNRESOLVED_REFERENCE!>ULong<!>(3)
|
||||
const val ub0 = UByte(1)
|
||||
const val us0 = UShort(2)
|
||||
const val ul0 = ULong(3)
|
||||
|
||||
const val ui0 = <!UNRESOLVED_REFERENCE!>UInt<!>(-1)
|
||||
const val ui1 = <!UNRESOLVED_REFERENCE!>UInt<!>(0)
|
||||
const val ui2 = <!UNRESOLVED_REFERENCE!>UInt<!>(40 + 2)
|
||||
const val ui0 = UInt(-1)
|
||||
const val ui1 = UInt(0)
|
||||
const val ui2 = UInt(40 + 2)
|
||||
|
||||
@AnnoUB(<!UNRESOLVED_REFERENCE!>UByte<!>(1), ub0)
|
||||
@AnnoUB(UByte(1), ub0)
|
||||
fun f0() {}
|
||||
|
||||
@AnnoUS(<!UNRESOLVED_REFERENCE!>UShort<!>(2 + 5), us0)
|
||||
@AnnoUS(UShort(<!ARGUMENT_TYPE_MISMATCH!>2 + 5<!>), us0)
|
||||
fun f1() {}
|
||||
|
||||
@AnnoUI(ui0, ui1, ui2, <!UNRESOLVED_REFERENCE!>UInt<!>(100))
|
||||
@AnnoUI(ui0, ui1, ui2, UInt(100))
|
||||
fun f2() {}
|
||||
|
||||
@AnnoUL(ul0, <!UNRESOLVED_REFERENCE!>ULong<!>(5))
|
||||
@AnnoUL(ul0, ULong(5))
|
||||
fun f3() {}
|
||||
|
||||
const val explicit: <!UNRESOLVED_REFERENCE!>UInt<!> = <!UNRESOLVED_REFERENCE!>UInt<!>(2)
|
||||
const val explicit: UInt = UInt(2)
|
||||
|
||||
const val nullable: <!UNRESOLVED_REFERENCE!>UInt?<!> = <!UNRESOLVED_REFERENCE!>UInt<!>(3)
|
||||
<!TYPE_CANT_BE_USED_FOR_CONST_VAL!>const<!> val nullable: UInt? = UInt(3)
|
||||
|
||||
annotation class NullableAnno(val u: <!UNRESOLVED_REFERENCE!>UInt?<!>)
|
||||
annotation class NullableAnno(val u: <!NULLABLE_TYPE_OF_ANNOTATION_MEMBER!>UInt?<!>)
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// !LANGUAGE: +InlineClasses, -JvmInlineValueClasses
|
||||
// SKIP_JAVAC
|
||||
// ALLOW_KOTLIN_PACKAGE
|
||||
|
||||
// FILE: uint.kt
|
||||
|
||||
|
||||
+4
-4
@@ -49,16 +49,16 @@ fun test() {
|
||||
|
||||
val bc: <!UNRESOLVED_REFERENCE!>B.NC<!> = B.<!UNRESOLVED_REFERENCE!>NC<!>()
|
||||
val bic: <!UNRESOLVED_REFERENCE!>B.IC<!> = B().IC()
|
||||
val bi: <!UNRESOLVED_REFERENCE!>B.NI?<!> = null
|
||||
val bi: <!UNRESOLVED_REFERENCE!>B.NI<!>? = null
|
||||
|
||||
val cc: <!UNRESOLVED_REFERENCE!>C.NC<!> = C.<!UNRESOLVED_REFERENCE!>NC<!>()
|
||||
val ci: <!UNRESOLVED_REFERENCE!>C.NI?<!> = null
|
||||
val ci: <!UNRESOLVED_REFERENCE!>C.NI<!>? = null
|
||||
|
||||
val dc: <!UNRESOLVED_REFERENCE!>D.NC<!> = D.<!UNRESOLVED_REFERENCE!>NC<!>()
|
||||
val dic: <!UNRESOLVED_REFERENCE!>D.IC<!> = D().IC()
|
||||
val di: <!UNRESOLVED_REFERENCE!>D.NI?<!> = null
|
||||
val di: <!UNRESOLVED_REFERENCE!>D.NI<!>? = null
|
||||
|
||||
val kc: <!UNRESOLVED_REFERENCE!>K.NC<!> = K.<!UNRESOLVED_REFERENCE!>NC<!>()
|
||||
val kic: <!UNRESOLVED_REFERENCE!>K.IC<!> = K().IC()
|
||||
val ki: <!UNRESOLVED_REFERENCE!>K.NI?<!> = null
|
||||
val ki: <!UNRESOLVED_REFERENCE!>K.NI<!>? = null
|
||||
}
|
||||
|
||||
+3
-3
@@ -33,12 +33,12 @@ fun test() {
|
||||
|
||||
val bc: <!UNRESOLVED_REFERENCE!>B.NC<!> = B.<!UNRESOLVED_REFERENCE!>NC<!>()
|
||||
val bic: <!UNRESOLVED_REFERENCE!>B.IC<!> = B().IC()
|
||||
val bi: <!UNRESOLVED_REFERENCE!>B.NI?<!> = null
|
||||
val bi: <!UNRESOLVED_REFERENCE!>B.NI<!>? = null
|
||||
|
||||
val cc: <!UNRESOLVED_REFERENCE!>C.NC<!> = C.<!UNRESOLVED_REFERENCE!>NC<!>()
|
||||
val ci: <!UNRESOLVED_REFERENCE!>C.NI?<!> = null
|
||||
val ci: <!UNRESOLVED_REFERENCE!>C.NI<!>? = null
|
||||
|
||||
val dc: <!UNRESOLVED_REFERENCE!>D.NC<!> = D.<!UNRESOLVED_REFERENCE!>NC<!>()
|
||||
val dic: <!UNRESOLVED_REFERENCE!>D.IC<!> = D().IC()
|
||||
val di: <!UNRESOLVED_REFERENCE!>D.NI?<!> = null
|
||||
val di: <!UNRESOLVED_REFERENCE!>D.NI<!>? = null
|
||||
}
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
// FILE: J.java
|
||||
public interface J {
|
||||
@Deprecated
|
||||
public void foo();
|
||||
|
||||
@Deprecated
|
||||
public String bar();
|
||||
|
||||
@Deprecated
|
||||
public CharSequence baz();
|
||||
}
|
||||
// FILE: J2.java
|
||||
public interface J2 extends J, K {
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
interface K {
|
||||
fun bar(): CharSequence
|
||||
fun baz(): String
|
||||
}
|
||||
|
||||
interface A : J, K
|
||||
|
||||
fun main(j: J, j2: J2, a: A) {
|
||||
j.foo()
|
||||
j2.foo()
|
||||
a.foo()
|
||||
|
||||
j.bar()
|
||||
j2.bar()
|
||||
a.bar()
|
||||
|
||||
j.baz()
|
||||
j2.baz()
|
||||
a.baz()
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// FILE: J.java
|
||||
public interface J {
|
||||
@Deprecated
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ class A : J(), WithDeprecation {
|
||||
}
|
||||
|
||||
fun main() {
|
||||
J().foo()
|
||||
J().<!DEPRECATION!>foo<!>()
|
||||
|
||||
J2().foo()
|
||||
A().foo()
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
// FILE: J.java
|
||||
public interface J {
|
||||
@Deprecated
|
||||
public void foo();
|
||||
|
||||
}
|
||||
// FILE: J2.java
|
||||
public interface J2 extends J {
|
||||
@Override
|
||||
public void foo();
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
|
||||
interface A : J {
|
||||
override fun foo()
|
||||
}
|
||||
|
||||
fun main(j: J, j2: J2, a: A) {
|
||||
j.foo()
|
||||
j2.foo()
|
||||
a.foo()
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// FILE: J.java
|
||||
public interface J {
|
||||
@Deprecated
|
||||
|
||||
Vendored
+1
-1
@@ -31,7 +31,7 @@ fun test(a: <!UNRESOLVED_REFERENCE!>A<!>) {
|
||||
import p1.A
|
||||
import p2.*
|
||||
|
||||
fun test(a: A) {
|
||||
fun test(a: <!DEPRECATION_ERROR!>A<!>) {
|
||||
a.m1()
|
||||
a.<!UNRESOLVED_REFERENCE!>m2<!>()
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -28,7 +28,7 @@ import p1.*
|
||||
import p2.A
|
||||
import p3.*
|
||||
|
||||
fun test(a: A) {
|
||||
fun test(a: <!DEPRECATION_ERROR!>A<!>) {
|
||||
a.<!UNRESOLVED_REFERENCE!>v1<!>
|
||||
a.v2
|
||||
a.<!UNRESOLVED_REFERENCE!>v3<!>
|
||||
|
||||
Vendored
-99
@@ -1,99 +0,0 @@
|
||||
// !LANGUAGE: +ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion
|
||||
|
||||
// See KT-21515 for a class diagram and details
|
||||
|
||||
// Object is to prevent accidental short-name import
|
||||
object O {
|
||||
open class Alpha {
|
||||
class FromAlpha
|
||||
|
||||
companion object {
|
||||
class FromCompanionAlpha
|
||||
}
|
||||
}
|
||||
|
||||
open class Beta : Alpha() {
|
||||
class FromBeta
|
||||
|
||||
companion object {
|
||||
class FromCompanionBeta
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
open class A {
|
||||
class FromA
|
||||
|
||||
companion object : Beta() {
|
||||
class FromCompanionA
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////
|
||||
|
||||
open class FarAway {
|
||||
class FromFarAway
|
||||
|
||||
}
|
||||
|
||||
open class Gamma {
|
||||
class FromGamma
|
||||
companion object : FarAway() {
|
||||
class FromCompanionGamma
|
||||
}
|
||||
}
|
||||
|
||||
open class B : A() {
|
||||
class FromB
|
||||
|
||||
companion object : Gamma() {
|
||||
class FromCompanionB
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////
|
||||
|
||||
|
||||
open class Delta {
|
||||
class FromDelta
|
||||
}
|
||||
|
||||
class C : O.B() {
|
||||
companion object : Delta() {
|
||||
class FromCompanionC
|
||||
}
|
||||
|
||||
// VISIBLE: Classifiers from direct superclasses
|
||||
val c: FromA? = null
|
||||
val d: FromB? = null
|
||||
|
||||
// VISIBLE: Classifiers from our own companion
|
||||
val n: FromCompanionC? = null
|
||||
|
||||
// INVISIBLE: direct superclasses themselves.
|
||||
val a: <!UNRESOLVED_REFERENCE!>A?<!> = null
|
||||
val b: <!UNRESOLVED_REFERENCE!>B?<!> = null
|
||||
|
||||
// DEPRECATED: Classifiers from companions of direct superclasses
|
||||
val e: <!UNRESOLVED_REFERENCE!>FromCompanionA?<!> = null
|
||||
val f: <!UNRESOLVED_REFERENCE!>FromCompanionB?<!> = null
|
||||
|
||||
// INVISIBLE: "cousin" supertypes themselves
|
||||
val g: <!UNRESOLVED_REFERENCE!>Alpha?<!> = null
|
||||
val h: <!UNRESOLVED_REFERENCE!>Beta?<!> = null
|
||||
val i: <!UNRESOLVED_REFERENCE!>Gamma?<!> = null
|
||||
|
||||
// DEPRECATED: classifiers from "cousin" superclasses
|
||||
val k: <!UNRESOLVED_REFERENCE!>FromAlpha?<!> = null
|
||||
val l: <!UNRESOLVED_REFERENCE!>FromBeta?<!> = null
|
||||
val m: <!UNRESOLVED_REFERENCE!>FromGamma?<!> = null
|
||||
|
||||
// INVISIBLE: We don't see classifiers from companions of "cousin" superclasses
|
||||
val o: <!UNRESOLVED_REFERENCE!>FromCompanionAlpha?<!> = null
|
||||
val p: <!UNRESOLVED_REFERENCE!>FromCompanionBeta?<!> = null
|
||||
val q: <!UNRESOLVED_REFERENCE!>FromCompanionGamma?<!> = null
|
||||
|
||||
// DEPRECATED: Classifiers from supertypes of our own companion
|
||||
val r: <!UNRESOLVED_REFERENCE!>FromDelta?<!> = null
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: +ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion
|
||||
|
||||
// See KT-21515 for a class diagram and details
|
||||
|
||||
Vendored
+14
-14
@@ -71,28 +71,28 @@ class C : O.B() {
|
||||
val n: FromCompanionC? = null
|
||||
|
||||
// INVISIBLE: direct superclasses themselves.
|
||||
val a: <!UNRESOLVED_REFERENCE!>A?<!> = null
|
||||
val b: <!UNRESOLVED_REFERENCE!>B?<!> = null
|
||||
val a: <!UNRESOLVED_REFERENCE!>A<!>? = null
|
||||
val b: <!UNRESOLVED_REFERENCE!>B<!>? = null
|
||||
|
||||
// DEPRECATED: Classifiers from companions of direct superclasses
|
||||
val e: <!UNRESOLVED_REFERENCE!>FromCompanionA?<!> = null
|
||||
val f: <!UNRESOLVED_REFERENCE!>FromCompanionB?<!> = null
|
||||
val e: <!UNRESOLVED_REFERENCE!>FromCompanionA<!>? = null
|
||||
val f: <!UNRESOLVED_REFERENCE!>FromCompanionB<!>? = null
|
||||
|
||||
// INVISIBLE: "cousin" supertypes themselves
|
||||
val g: <!UNRESOLVED_REFERENCE!>Alpha?<!> = null
|
||||
val h: <!UNRESOLVED_REFERENCE!>Beta?<!> = null
|
||||
val i: <!UNRESOLVED_REFERENCE!>Gamma?<!> = null
|
||||
val g: <!UNRESOLVED_REFERENCE!>Alpha<!>? = null
|
||||
val h: <!UNRESOLVED_REFERENCE!>Beta<!>? = null
|
||||
val i: <!UNRESOLVED_REFERENCE!>Gamma<!>? = null
|
||||
|
||||
// DEPRECATED: classifiers from "cousin" superclasses
|
||||
val k: <!UNRESOLVED_REFERENCE!>FromAlpha?<!> = null
|
||||
val l: <!UNRESOLVED_REFERENCE!>FromBeta?<!> = null
|
||||
val m: <!UNRESOLVED_REFERENCE!>FromGamma?<!> = null
|
||||
val k: <!UNRESOLVED_REFERENCE!>FromAlpha<!>? = null
|
||||
val l: <!UNRESOLVED_REFERENCE!>FromBeta<!>? = null
|
||||
val m: <!UNRESOLVED_REFERENCE!>FromGamma<!>? = null
|
||||
|
||||
// INVISIBLE: We don't see classifiers from companions of "cousin" superclasses
|
||||
val o: <!UNRESOLVED_REFERENCE!>FromCompanionAlpha?<!> = null
|
||||
val p: <!UNRESOLVED_REFERENCE!>FromCompanionBeta?<!> = null
|
||||
val q: <!UNRESOLVED_REFERENCE!>FromCompanionGamma?<!> = null
|
||||
val o: <!UNRESOLVED_REFERENCE!>FromCompanionAlpha<!>? = null
|
||||
val p: <!UNRESOLVED_REFERENCE!>FromCompanionBeta<!>? = null
|
||||
val q: <!UNRESOLVED_REFERENCE!>FromCompanionGamma<!>? = null
|
||||
|
||||
// DEPRECATED: Classifiers from supertypes of our own companion
|
||||
val r: <!UNRESOLVED_REFERENCE!>FromDelta?<!> = null
|
||||
val r: <!UNRESOLVED_REFERENCE!>FromDelta<!>? = null
|
||||
}
|
||||
+1
-1
@@ -9,7 +9,7 @@ object A {
|
||||
}
|
||||
|
||||
fun test() {
|
||||
takeString(<!ARGUMENT_TYPE_MISMATCH!>A % 123<!>)
|
||||
takeString(<!ARGUMENT_TYPE_MISMATCH!>A <!INVISIBLE_REFERENCE!>%<!> 123<!>)
|
||||
}
|
||||
|
||||
fun takeString(s: String) {}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
fun bar() {
|
||||
fun <T: <!UNRESOLVED_REFERENCE!>T?<!>> foo() {}
|
||||
fun <T: <!UNRESOLVED_REFERENCE!>T<!>?> foo() {}
|
||||
<!INAPPLICABLE_CANDIDATE!>foo<!>()
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ fun String.topLevelExtensionFun(){}
|
||||
val String.topLevelExtensionProperty: Int get() = 1
|
||||
|
||||
open class A {
|
||||
constructor(p: Int) : this("") {}
|
||||
constructor(p: Int) : this(<!ARGUMENT_TYPE_MISMATCH!>""<!>) {}
|
||||
|
||||
@Deprecated("hidden", level = DeprecationLevel.HIDDEN)
|
||||
constructor(s: String){}
|
||||
@@ -35,17 +35,17 @@ open class A {
|
||||
val String.memberExtensionProperty: Int get() = 1
|
||||
|
||||
fun foo() {
|
||||
topLevelFun()
|
||||
topLevelProperty++
|
||||
"".topLevelExtensionFun()
|
||||
"".topLevelExtensionProperty
|
||||
<!INVISIBLE_REFERENCE!>topLevelFun<!>()
|
||||
<!INVISIBLE_REFERENCE, INVISIBLE_REFERENCE!>topLevelProperty<!>++
|
||||
"".<!INVISIBLE_REFERENCE!>topLevelExtensionFun<!>()
|
||||
"".<!INVISIBLE_REFERENCE!>topLevelExtensionProperty<!>
|
||||
|
||||
memberFun()
|
||||
memberProperty
|
||||
"".memberExtensionFun()
|
||||
"".memberExtensionProperty
|
||||
<!INVISIBLE_REFERENCE!>memberFun<!>()
|
||||
<!INVISIBLE_REFERENCE!>memberProperty<!>
|
||||
"".<!INVISIBLE_REFERENCE!>memberExtensionFun<!>()
|
||||
"".<!INVISIBLE_REFERENCE!>memberExtensionProperty<!>
|
||||
|
||||
A("")
|
||||
A(<!ARGUMENT_TYPE_MISMATCH!>""<!>)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,13 +62,13 @@ interface I {
|
||||
}
|
||||
}
|
||||
|
||||
class B : A("") {
|
||||
class B : A(<!ARGUMENT_TYPE_MISMATCH!>""<!>) {
|
||||
// still can override it
|
||||
override fun memberFun() {
|
||||
super.memberFun() // but cannot call super :)
|
||||
super.<!INVISIBLE_REFERENCE!>memberFun<!>() // but cannot call super :)
|
||||
}
|
||||
}
|
||||
|
||||
class C : A {
|
||||
constructor() : super("")
|
||||
}
|
||||
constructor() : super(<!ARGUMENT_TYPE_MISMATCH!>""<!>)
|
||||
}
|
||||
|
||||
+8
-8
@@ -1,18 +1,18 @@
|
||||
// FILE: KotlinFile.kt
|
||||
fun foo(javaClass: JavaClass) {
|
||||
javaClass.something1
|
||||
javaClass.<!DEPRECATION!>something1<!>
|
||||
|
||||
javaClass.something2
|
||||
javaClass.<!DEPRECATION!>something2<!>
|
||||
javaClass.something2 = 1
|
||||
javaClass.something2++
|
||||
javaClass.<!DEPRECATION!>something2<!>++
|
||||
|
||||
javaClass.something3
|
||||
javaClass.something3 = 1
|
||||
javaClass.something3++
|
||||
javaClass.something3 <!DEPRECATION!>=<!> 1
|
||||
javaClass.something3<!DEPRECATION!>++<!>
|
||||
|
||||
javaClass.something4
|
||||
javaClass.something4 = 1
|
||||
javaClass.something4++
|
||||
javaClass.<!DEPRECATION!>something4<!>
|
||||
javaClass.something4 <!DEPRECATION!>=<!> 1
|
||||
javaClass.<!DEPRECATION!>something4<!><!DEPRECATION!>++<!>
|
||||
|
||||
javaClass.something5
|
||||
javaClass.something5 = 1
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ public interface I {
|
||||
}
|
||||
|
||||
fun foo(javaClass: JavaClass) {
|
||||
javaClass.doSomething1 { bar() }
|
||||
javaClass.<!DEPRECATION!>doSomething1<!> { bar() }
|
||||
javaClass.doSomething2 { bar() }
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// !JVM_DEFAULT_MODE: enable
|
||||
|
||||
interface A<T> {
|
||||
@JvmDefault
|
||||
@<!DEPRECATION!>JvmDefault<!>
|
||||
fun test(p: T) {
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -13,7 +13,7 @@ public interface JavaInterface {
|
||||
// FILE: 1.kt
|
||||
|
||||
interface KotlinInterface : JavaInterface {
|
||||
@JvmDefault
|
||||
@<!DEPRECATION!>JvmDefault<!>
|
||||
override fun test() {}
|
||||
|
||||
override fun testForNonDefault() {}
|
||||
@@ -22,7 +22,7 @@ interface KotlinInterface : JavaInterface {
|
||||
}
|
||||
|
||||
interface KotlinInterface2 : JavaInterface, KotlinInterface {
|
||||
@JvmDefault
|
||||
@<!DEPRECATION!>JvmDefault<!>
|
||||
override fun test() {}
|
||||
|
||||
override fun testForNonDefault() {}
|
||||
@@ -37,7 +37,7 @@ interface KotlinInterfaceForIndirect : JavaInterface {
|
||||
|
||||
interface KotlinInterfaceIndirectInheritance : KotlinInterfaceForIndirect {
|
||||
|
||||
@JvmDefault
|
||||
@<!DEPRECATION!>JvmDefault<!>
|
||||
override fun test() {}
|
||||
|
||||
override fun testForNonDefault() {}
|
||||
@@ -63,7 +63,7 @@ interface KotlinInterfaceX {
|
||||
}
|
||||
|
||||
interface KotlinInterfaceManySuper: JavaInterface, KotlinInterfaceX {
|
||||
@JvmDefault
|
||||
@<!DEPRECATION!>JvmDefault<!>
|
||||
override fun test() {}
|
||||
|
||||
override fun testForNonDefault() {}
|
||||
|
||||
Vendored
-69
@@ -1,69 +0,0 @@
|
||||
// !JVM_DEFAULT_MODE: all
|
||||
// !JVM_TARGET: 1.8
|
||||
|
||||
// FILE: JavaInterface.java
|
||||
public interface JavaInterface {
|
||||
default void test() {}
|
||||
|
||||
default void testForNonDefault() {}
|
||||
|
||||
void testAbstract();
|
||||
}
|
||||
|
||||
// FILE: 1.kt
|
||||
|
||||
interface KotlinInterface : JavaInterface {
|
||||
@JvmDefault
|
||||
override fun test() {}
|
||||
|
||||
override fun testForNonDefault() {}
|
||||
|
||||
override fun testAbstract() {}
|
||||
}
|
||||
|
||||
interface KotlinInterface2 : JavaInterface, KotlinInterface {
|
||||
override fun test() {}
|
||||
|
||||
override fun testForNonDefault() {}
|
||||
|
||||
override fun testAbstract() {}
|
||||
}
|
||||
|
||||
|
||||
interface KotlinInterfaceForIndirect : JavaInterface {
|
||||
|
||||
}
|
||||
|
||||
interface KotlinInterfaceIndirectInheritance : KotlinInterfaceForIndirect {
|
||||
|
||||
override fun test() {}
|
||||
|
||||
override fun testForNonDefault() {}
|
||||
|
||||
override fun testAbstract() {}
|
||||
}
|
||||
|
||||
open class KotlinClass : JavaInterface {
|
||||
override fun test() {}
|
||||
|
||||
override fun testForNonDefault() {}
|
||||
|
||||
override fun testAbstract() {}
|
||||
}
|
||||
|
||||
interface KotlinInterfaceX {
|
||||
|
||||
fun test() {}
|
||||
|
||||
fun testForNonDefault() {}
|
||||
|
||||
fun testAbstract() {}
|
||||
}
|
||||
|
||||
interface KotlinInterfaceManySuper: JavaInterface, KotlinInterfaceX {
|
||||
override fun test() {}
|
||||
|
||||
override fun testForNonDefault() {}
|
||||
|
||||
override fun testAbstract() {}
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !JVM_DEFAULT_MODE: all
|
||||
// !JVM_TARGET: 1.8
|
||||
|
||||
|
||||
Vendored
+2
-2
@@ -1,7 +1,7 @@
|
||||
// !JVM_TARGET: 1.8
|
||||
|
||||
interface A {
|
||||
@JvmDefault
|
||||
@<!DEPRECATION!>JvmDefault<!>
|
||||
fun test() {
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,7 @@ class Bar2 : Foo(), A
|
||||
class Bar3 : Foo(), B
|
||||
|
||||
open class BarWithJvmDefault : B {
|
||||
@JvmDefault
|
||||
@<!DEPRECATION!>JvmDefault<!>
|
||||
override fun test() {
|
||||
}
|
||||
}
|
||||
|
||||
+6
-6
@@ -2,12 +2,12 @@
|
||||
// !JVM_TARGET: 1.8
|
||||
|
||||
public interface KInterface {
|
||||
@JvmDefault
|
||||
@<!DEPRECATION!>JvmDefault<!>
|
||||
fun test(): String {
|
||||
return "OK";
|
||||
}
|
||||
|
||||
@JvmDefault
|
||||
@<!DEPRECATION!>JvmDefault<!>
|
||||
val property: String
|
||||
get() = "OK"
|
||||
|
||||
@@ -23,7 +23,7 @@ public interface KInterface {
|
||||
// FILE: 1.kt
|
||||
|
||||
interface KotlinInterface : KInterface {
|
||||
@JvmDefault
|
||||
@<!DEPRECATION!>JvmDefault<!>
|
||||
fun fooo() {
|
||||
super.test()
|
||||
super.property
|
||||
@@ -42,7 +42,7 @@ interface KotlinInterface : KInterface {
|
||||
}
|
||||
}
|
||||
|
||||
@JvmDefault
|
||||
@<!DEPRECATION!>JvmDefault<!>
|
||||
val propertyy: String
|
||||
get() {
|
||||
super.test()
|
||||
@@ -105,7 +105,7 @@ interface KotlinInterface : KInterface {
|
||||
}
|
||||
|
||||
interface KotlinInterfaceIndirectInheritance : KotlinInterface {
|
||||
@JvmDefault
|
||||
@<!DEPRECATION!>JvmDefault<!>
|
||||
fun foooo() {
|
||||
super.test()
|
||||
super.property
|
||||
@@ -124,7 +124,7 @@ interface KotlinInterfaceIndirectInheritance : KotlinInterface {
|
||||
}
|
||||
}
|
||||
|
||||
@JvmDefault
|
||||
@<!DEPRECATION!>JvmDefault<!>
|
||||
val propertyyy: String
|
||||
get() {
|
||||
super.test()
|
||||
|
||||
Vendored
-162
@@ -1,162 +0,0 @@
|
||||
// !JVM_DEFAULT_MODE: enable
|
||||
// !JVM_TARGET: 1.8
|
||||
// FILE: JavaInterface.java
|
||||
|
||||
public interface JavaInterface {
|
||||
default String test() {
|
||||
return "OK";
|
||||
}
|
||||
|
||||
default String testOverride() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 1.kt
|
||||
|
||||
interface KotlinInterface : JavaInterface {
|
||||
@JvmDefault
|
||||
fun fooo() {
|
||||
super.test()
|
||||
|
||||
object {
|
||||
fun run () {
|
||||
super@KotlinInterface.test()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@JvmDefault
|
||||
val propertyy: String
|
||||
get() {
|
||||
super.test()
|
||||
|
||||
object {
|
||||
fun run () {
|
||||
super@KotlinInterface.test()
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
@JvmDefault
|
||||
override fun testOverride(): String {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
|
||||
interface KotlinInterfaceIndirectInheritance : KotlinInterface {
|
||||
@JvmDefault
|
||||
fun foooo() {
|
||||
super.test()
|
||||
|
||||
object {
|
||||
fun run () {
|
||||
super@KotlinInterfaceIndirectInheritance.test()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@JvmDefault
|
||||
val propertyyy: String
|
||||
get() {
|
||||
super.test()
|
||||
|
||||
object {
|
||||
fun run () {
|
||||
super@KotlinInterfaceIndirectInheritance.test()
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
open class KotlinClass : JavaInterface {
|
||||
fun foo() {
|
||||
super.test()
|
||||
super.testOverride()
|
||||
|
||||
object {
|
||||
fun run () {
|
||||
super@KotlinClass.test()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val property: String
|
||||
get() {
|
||||
super.test()
|
||||
super.testOverride()
|
||||
|
||||
object {
|
||||
fun run () {
|
||||
super@KotlinClass.test()
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
class KotlinClassIndirectInheritance : KotlinClass() {
|
||||
fun foo2() {
|
||||
super.test()
|
||||
super.testOverride()
|
||||
|
||||
object {
|
||||
fun run () {
|
||||
super@KotlinClassIndirectInheritance.test()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val property2: String
|
||||
get() {
|
||||
super.test()
|
||||
super.testOverride()
|
||||
|
||||
object {
|
||||
fun run () {
|
||||
super@KotlinClassIndirectInheritance.test()
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
class KotlinClassIndirectInheritance2 : KotlinInterfaceIndirectInheritance {
|
||||
fun foo() {
|
||||
super.test()
|
||||
super.testOverride()
|
||||
|
||||
object {
|
||||
fun run () {
|
||||
super@KotlinClassIndirectInheritance2.test()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val property: String
|
||||
get() {
|
||||
super.test()
|
||||
super.testOverride()
|
||||
|
||||
object {
|
||||
fun run () {
|
||||
super@KotlinClassIndirectInheritance2.test()
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
fun test() {
|
||||
KotlinClass().foo()
|
||||
KotlinClass().property
|
||||
KotlinClassIndirectInheritance2().foo()
|
||||
KotlinClassIndirectInheritance2().property
|
||||
|
||||
KotlinClass().test()
|
||||
KotlinClass().property
|
||||
KotlinClass().testOverride()
|
||||
KotlinClassIndirectInheritance().testOverride()
|
||||
}
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !JVM_DEFAULT_MODE: enable
|
||||
// !JVM_TARGET: 1.8
|
||||
// FILE: JavaInterface.java
|
||||
|
||||
Vendored
+7
-7
@@ -2,27 +2,27 @@
|
||||
|
||||
interface B {
|
||||
|
||||
@JvmDefault
|
||||
@<!DEPRECATION!>JvmDefault<!>
|
||||
fun test() {}
|
||||
|
||||
@JvmDefault
|
||||
@<!DEPRECATION!>JvmDefault<!>
|
||||
abstract fun test2(s: String = "")
|
||||
|
||||
@JvmDefault
|
||||
@<!DEPRECATION!>JvmDefault<!>
|
||||
abstract fun test3()
|
||||
|
||||
|
||||
@JvmDefault
|
||||
@<!DEPRECATION!>JvmDefault<!>
|
||||
abstract val prop: String
|
||||
|
||||
@JvmDefault
|
||||
@<!DEPRECATION!>JvmDefault<!>
|
||||
abstract val prop2: String
|
||||
|
||||
@JvmDefault
|
||||
@<!DEPRECATION!>JvmDefault<!>
|
||||
val prop3: String
|
||||
get() = ""
|
||||
|
||||
@JvmDefault
|
||||
@<!DEPRECATION!>JvmDefault<!>
|
||||
var prop4: String
|
||||
get() = ""
|
||||
set(value) {}
|
||||
|
||||
+5
-5
@@ -2,21 +2,21 @@
|
||||
|
||||
abstract class A {
|
||||
|
||||
@JvmDefault
|
||||
@<!DEPRECATION!>JvmDefault<!>
|
||||
fun test() {}
|
||||
|
||||
@JvmDefault
|
||||
@<!DEPRECATION!>JvmDefault<!>
|
||||
abstract fun test2(s: String = "")
|
||||
|
||||
@JvmDefault
|
||||
@<!DEPRECATION!>JvmDefault<!>
|
||||
abstract fun test3()
|
||||
}
|
||||
|
||||
object B {
|
||||
|
||||
@JvmDefault
|
||||
@<!DEPRECATION!>JvmDefault<!>
|
||||
fun test() {}
|
||||
|
||||
@JvmDefault
|
||||
@<!DEPRECATION!>JvmDefault<!>
|
||||
fun test2(s: String = "") {}
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -3,7 +3,7 @@
|
||||
|
||||
interface B {
|
||||
|
||||
@JvmDefault
|
||||
@<!DEPRECATION!>JvmDefault<!>
|
||||
val prop1: String
|
||||
<!WRONG_ANNOTATION_TARGET!>@JvmDefault<!> get() = ""
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// !JVM_DEFAULT_MODE: enable
|
||||
|
||||
interface A {
|
||||
@JvmDefault
|
||||
@<!DEPRECATION!>JvmDefault<!>
|
||||
fun test() {}
|
||||
}
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@
|
||||
// !JVM_DEFAULT_MODE: enable
|
||||
|
||||
interface A {
|
||||
@JvmDefault
|
||||
@<!DEPRECATION!>JvmDefault<!>
|
||||
val test: String
|
||||
get() = "OK"
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
// !JVM_TARGET: 1.8
|
||||
// FILE: 1.kt
|
||||
interface A {
|
||||
@JvmDefault
|
||||
@<!DEPRECATION!>JvmDefault<!>
|
||||
fun test() {
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@ interface B : A {
|
||||
}
|
||||
|
||||
interface C : B {
|
||||
@JvmDefault
|
||||
@<!DEPRECATION!>JvmDefault<!>
|
||||
override fun test() {
|
||||
super.test()
|
||||
}
|
||||
|
||||
Vendored
+3
-3
@@ -1,6 +1,6 @@
|
||||
// !JVM_TARGET: 1.8
|
||||
interface A {
|
||||
@JvmDefault
|
||||
@<!DEPRECATION!>JvmDefault<!>
|
||||
fun test() {
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@ interface B{
|
||||
|
||||
|
||||
interface C : A, B {
|
||||
@JvmDefault
|
||||
@<!DEPRECATION!>JvmDefault<!>
|
||||
override fun test() {
|
||||
super<B>.test()
|
||||
super<A>.test()
|
||||
@@ -24,7 +24,7 @@ interface C : A, B {
|
||||
}
|
||||
|
||||
interface D : B, A {
|
||||
@JvmDefault
|
||||
@<!DEPRECATION!>JvmDefault<!>
|
||||
override fun test() {
|
||||
super<B>.test()
|
||||
super<A>.test()
|
||||
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
// !JVM_TARGET: 1.8
|
||||
interface A {
|
||||
@JvmDefault
|
||||
@<!DEPRECATION!>JvmDefault<!>
|
||||
fun test()
|
||||
}
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
// !JVM_TARGET: 1.8
|
||||
interface A {
|
||||
@JvmDefault
|
||||
@<!DEPRECATION!>JvmDefault<!>
|
||||
fun test() {
|
||||
|
||||
}
|
||||
|
||||
+7
-7
@@ -2,27 +2,27 @@
|
||||
|
||||
interface B {
|
||||
|
||||
@JvmDefault
|
||||
@<!DEPRECATION!>JvmDefault<!>
|
||||
fun test() {}
|
||||
|
||||
@JvmDefault
|
||||
@<!DEPRECATION!>JvmDefault<!>
|
||||
abstract fun test2(s: String = "")
|
||||
|
||||
@JvmDefault
|
||||
@<!DEPRECATION!>JvmDefault<!>
|
||||
abstract fun test3()
|
||||
|
||||
|
||||
@JvmDefault
|
||||
@<!DEPRECATION!>JvmDefault<!>
|
||||
abstract val prop: String
|
||||
|
||||
@JvmDefault
|
||||
@<!DEPRECATION!>JvmDefault<!>
|
||||
abstract val prop2: String
|
||||
|
||||
@JvmDefault
|
||||
@<!DEPRECATION!>JvmDefault<!>
|
||||
val prop3: String
|
||||
get() = ""
|
||||
|
||||
@JvmDefault
|
||||
@<!DEPRECATION!>JvmDefault<!>
|
||||
var prop4: String
|
||||
get() = ""
|
||||
set(value) {}
|
||||
|
||||
-30
@@ -1,30 +0,0 @@
|
||||
// !JVM_TARGET: 1.8
|
||||
// !JVM_DEFAULT_MODE: enable
|
||||
|
||||
interface B {
|
||||
|
||||
@JvmDefault
|
||||
fun test() {}
|
||||
|
||||
@JvmDefault
|
||||
abstract fun test2(s: String = "")
|
||||
|
||||
@JvmDefault
|
||||
abstract fun test3()
|
||||
|
||||
|
||||
@JvmDefault
|
||||
abstract val prop: String
|
||||
|
||||
@JvmDefault
|
||||
abstract val prop2: String
|
||||
|
||||
@JvmDefault
|
||||
val prop3: String
|
||||
get() = ""
|
||||
|
||||
@JvmDefault
|
||||
var prop4: String
|
||||
get() = ""
|
||||
set(value) {}
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !JVM_TARGET: 1.8
|
||||
// !JVM_DEFAULT_MODE: enable
|
||||
|
||||
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
import java.io.InputStream
|
||||
|
||||
fun InputStream.test() {
|
||||
readBytes()
|
||||
|
||||
readBytes(1)
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
import java.io.InputStream
|
||||
|
||||
fun InputStream.test() {
|
||||
|
||||
Vendored
+15
-15
@@ -42,38 +42,38 @@ private val unaryOperations: HashMap<UnaryOperationKey<*>, Pair<Function1<Any?,
|
||||
unaryOperation(BYTE, "toInt", { a -> a.toInt() }, emptyUnaryFun),
|
||||
unaryOperation(BYTE, "minus", { a -> a.unaryMinus() }, { a -> a.unaryMinus() }),
|
||||
unaryOperation(BYTE, "minus", { a -> a.unaryMinus() }, { a -> a.unaryMinus() }),
|
||||
unaryOperation(BYTE, "toChar", { a -> a.toChar() }, emptyUnaryFun),
|
||||
unaryOperation(BYTE, "toChar", { a -> a.<!DEPRECATION!>toChar<!>() }, emptyUnaryFun),
|
||||
unaryOperation(BYTE, "toLong", { a -> a.toLong() }, emptyUnaryFun),
|
||||
unaryOperation(BYTE, "plus", { a -> a.unaryPlus() }, emptyUnaryFun),
|
||||
unaryOperation(BYTE, "toFloat", { a -> a.toFloat() }, emptyUnaryFun),
|
||||
unaryOperation(BYTE, "toDouble", { a -> a.toDouble() }, emptyUnaryFun),
|
||||
unaryOperation(BYTE, "toShort", { a -> a.toShort() }, emptyUnaryFun),
|
||||
unaryOperation(BYTE, "toByte", { a -> a.toByte() }, emptyUnaryFun),
|
||||
unaryOperation(CHAR, "toInt", { a -> a.toInt() }, emptyUnaryFun),
|
||||
unaryOperation(CHAR, "toInt", { a -> a.<!DEPRECATION!>toInt<!>() }, emptyUnaryFun),
|
||||
unaryOperation(CHAR, "toChar", { a -> a.toChar() }, emptyUnaryFun),
|
||||
unaryOperation(CHAR, "toLong", { a -> a.toLong() }, emptyUnaryFun),
|
||||
unaryOperation(CHAR, "toFloat", { a -> a.toFloat() }, emptyUnaryFun),
|
||||
unaryOperation(CHAR, "toDouble", { a -> a.toDouble() }, emptyUnaryFun),
|
||||
unaryOperation(CHAR, "toShort", { a -> a.toShort() }, emptyUnaryFun),
|
||||
unaryOperation(CHAR, "toByte", { a -> a.toByte() }, emptyUnaryFun),
|
||||
unaryOperation(CHAR, "toLong", { a -> a.<!DEPRECATION!>toLong<!>() }, emptyUnaryFun),
|
||||
unaryOperation(CHAR, "toFloat", { a -> a.<!DEPRECATION!>toFloat<!>() }, emptyUnaryFun),
|
||||
unaryOperation(CHAR, "toDouble", { a -> a.<!DEPRECATION!>toDouble<!>() }, emptyUnaryFun),
|
||||
unaryOperation(CHAR, "toShort", { a -> a.<!DEPRECATION!>toShort<!>() }, emptyUnaryFun),
|
||||
unaryOperation(CHAR, "toByte", { a -> a.<!DEPRECATION!>toByte<!>() }, emptyUnaryFun),
|
||||
unaryOperation(DOUBLE, "toInt", { a -> a.toInt() }, emptyUnaryFun),
|
||||
unaryOperation(DOUBLE, "minus", { a -> a.unaryMinus() }, emptyUnaryFun),
|
||||
unaryOperation(DOUBLE, "toChar", { a -> a.toChar() }, emptyUnaryFun),
|
||||
unaryOperation(DOUBLE, "toChar", { a -> a.<!DEPRECATION!>toChar<!>() }, emptyUnaryFun),
|
||||
unaryOperation(DOUBLE, "toLong", { a -> a.toLong() }, emptyUnaryFun),
|
||||
unaryOperation(DOUBLE, "plus", { a -> a.unaryPlus() }, emptyUnaryFun),
|
||||
unaryOperation(DOUBLE, "toFloat", { a -> a.toFloat() }, emptyUnaryFun),
|
||||
unaryOperation(DOUBLE, "toDouble", { a -> a.toDouble() }, emptyUnaryFun),
|
||||
unaryOperation(DOUBLE, "toShort", { a -> a.toShort() }, emptyUnaryFun),
|
||||
unaryOperation(DOUBLE, "toByte", { a -> a.toByte() }, emptyUnaryFun),
|
||||
unaryOperation(DOUBLE, "toShort", { a -> a.<!DEPRECATION_ERROR!>toShort<!>() }, emptyUnaryFun),
|
||||
unaryOperation(DOUBLE, "toByte", { a -> a.<!DEPRECATION_ERROR!>toByte<!>() }, emptyUnaryFun),
|
||||
unaryOperation(FLOAT, "toInt", { a -> a.toInt() }, emptyUnaryFun),
|
||||
unaryOperation(FLOAT, "minus", { a -> a.unaryMinus() }, emptyUnaryFun),
|
||||
unaryOperation(FLOAT, "toChar", { a -> a.toChar() }, emptyUnaryFun),
|
||||
unaryOperation(FLOAT, "toChar", { a -> a.<!DEPRECATION!>toChar<!>() }, emptyUnaryFun),
|
||||
unaryOperation(FLOAT, "toLong", { a -> a.toLong() }, emptyUnaryFun),
|
||||
unaryOperation(FLOAT, "plus", { a -> a.unaryPlus() }, emptyUnaryFun),
|
||||
unaryOperation(FLOAT, "toFloat", { a -> a.toFloat() }, emptyUnaryFun),
|
||||
unaryOperation(FLOAT, "toDouble", { a -> a.toDouble() }, emptyUnaryFun),
|
||||
unaryOperation(FLOAT, "toShort", { a -> a.toShort() }, emptyUnaryFun),
|
||||
unaryOperation(FLOAT, "toByte", { a -> a.toByte() }, emptyUnaryFun),
|
||||
unaryOperation(FLOAT, "toShort", { a -> a.<!DEPRECATION_ERROR!>toShort<!>() }, emptyUnaryFun),
|
||||
unaryOperation(FLOAT, "toByte", { a -> a.<!DEPRECATION_ERROR!>toByte<!>() }, emptyUnaryFun),
|
||||
unaryOperation(INT, "plus", { a -> a.unaryPlus() }, emptyUnaryFun),
|
||||
unaryOperation(INT, "toShort", { a -> a.toShort() }, emptyUnaryFun),
|
||||
unaryOperation(INT, "toByte", { a -> a.toByte() }, emptyUnaryFun),
|
||||
@@ -90,13 +90,13 @@ private val unaryOperations: HashMap<UnaryOperationKey<*>, Pair<Function1<Any?,
|
||||
unaryOperation(LONG, "inv", { a -> a.inv() }, emptyUnaryFun),
|
||||
unaryOperation(LONG, "toInt", { a -> a.toInt() }, emptyUnaryFun),
|
||||
unaryOperation(LONG, "minus", { a -> a.unaryMinus() }, { a -> a.unaryMinus() }),
|
||||
unaryOperation(LONG, "toChar", { a -> a.toChar() }, emptyUnaryFun),
|
||||
unaryOperation(LONG, "toChar", { a -> a.<!DEPRECATION!>toChar<!>() }, emptyUnaryFun),
|
||||
unaryOperation(LONG, "toLong", { a -> a.toLong() }, emptyUnaryFun),
|
||||
unaryOperation(LONG, "toDouble", { a -> a.toDouble() }, emptyUnaryFun),
|
||||
unaryOperation(LONG, "toFloat", { a -> a.toFloat() }, emptyUnaryFun),
|
||||
unaryOperation(SHORT, "toInt", { a -> a.toInt() }, emptyUnaryFun),
|
||||
unaryOperation(SHORT, "minus", { a -> a.unaryMinus() }, { a -> a.unaryMinus() }),
|
||||
unaryOperation(SHORT, "toChar", { a -> a.toChar() }, emptyUnaryFun),
|
||||
unaryOperation(SHORT, "toChar", { a -> a.<!DEPRECATION!>toChar<!>() }, emptyUnaryFun),
|
||||
unaryOperation(SHORT, "toLong", { a -> a.toLong() }, emptyUnaryFun),
|
||||
unaryOperation(SHORT, "plus", { a -> a.unaryPlus() }, emptyUnaryFun),
|
||||
unaryOperation(SHORT, "toFloat", { a -> a.toFloat() }, emptyUnaryFun),
|
||||
|
||||
+2
-2
@@ -7,14 +7,14 @@ abstract class A : MutableList<String> {
|
||||
}
|
||||
|
||||
fun foo(x: MutableList<String>, y: java.util.ArrayList<String>, z: A, p: java.util.Comparator<in String>) {
|
||||
x.sort(p)
|
||||
x.<!DEPRECATION_ERROR!>sort<!>(p)
|
||||
y.sort(p)
|
||||
|
||||
z.sort(p)
|
||||
}
|
||||
|
||||
fun bar(x: MutableList<String>, y: java.util.ArrayList<String>, z: A) {
|
||||
x.sort { a, b -> a.length - b.length }
|
||||
x.<!DEPRECATION_ERROR!>sort<!> { a, b -> a.length - b.length }
|
||||
y.sort { a, b -> a.length - b.length }
|
||||
|
||||
z.sort { a, b -> a.length - b.length }
|
||||
|
||||
Reference in New Issue
Block a user