Refine 1.0-compatibility mode for JDK dependent members
- calls must be prohibited iff they refer to some additonal built in member - override must be prohibited iff all of the overridden descriptors are additional Other usages were able to be successfully compiled by 1.0.x Solution with @Deprecated(level=Error) doesn't work properly, because deprecation propagates to overridden, thus call 'java.util.ArrayList<String>().stream()' becomes invalid, while it was correct in 1.0.x #KT-15794 Fixed
This commit is contained in:
+9
-5
@@ -3,20 +3,24 @@
|
||||
// SKIP_TXT
|
||||
|
||||
class A : java.util.ArrayList<String>() {
|
||||
<!UNSUPPORTED_FEATURE!>override<!> fun stream(): java.util.stream.Stream<String> = super.<!DEPRECATION_ERROR!>stream<!>()
|
||||
override fun stream(): java.util.stream.Stream<String> = super.stream()
|
||||
}
|
||||
|
||||
class A1 : java.util.ArrayList<String>() {
|
||||
fun stream(): java.util.stream.Stream<String> = super.<!DEPRECATION_ERROR!>stream<!>()
|
||||
fun stream(): java.util.stream.Stream<String> = super.stream()
|
||||
}
|
||||
|
||||
class B : <!DEPRECATION_ERROR!>Throwable<!>("", null, false, false)
|
||||
interface A2 : List<String> {
|
||||
<!UNSUPPORTED_FEATURE!>override<!> fun stream(): java.util.stream.Stream<String> = null!!
|
||||
}
|
||||
|
||||
class B : <!UNSUPPORTED_FEATURE!>Throwable<!>("", null, false, false)
|
||||
|
||||
fun Throwable.<!EXTENSION_SHADOWED_BY_MEMBER!>fillInStackTrace<!>() = 1
|
||||
|
||||
fun foo(x: List<String>, y: Throwable) {
|
||||
x.<!DEPRECATION_ERROR!>stream<!>()
|
||||
java.util.ArrayList<String>().<!DEPRECATION_ERROR!>stream<!>()
|
||||
x.<!UNSUPPORTED_FEATURE!>stream<!>()
|
||||
java.util.ArrayList<String>().stream()
|
||||
|
||||
y.fillInStackTrace() checkType { _<Int>() }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user