fix KT-431 Prohibit safe calls on namespaces, super etc
#KT-431 Fixed
This commit is contained in:
@@ -10,7 +10,7 @@ val s: String = "test"
|
||||
|
||||
// FILE: test.kt
|
||||
fun ff() {
|
||||
val a = Test?.FOO
|
||||
val b = foo?.s
|
||||
System?.out.println(a + b)
|
||||
}
|
||||
val a = Test<!UNEXPECTED_SAFE_CALL!>?.<!>FOO
|
||||
val b = foo<!UNEXPECTED_SAFE_CALL!>?.<!>s
|
||||
System<!UNEXPECTED_SAFE_CALL!>?.<!>out.println(a + b)
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// http://youtrack.jetbrains.net/issue/KT-413
|
||||
|
||||
open class A {
|
||||
fun f() {}
|
||||
}
|
||||
|
||||
class B : A() {
|
||||
fun g() {
|
||||
super<!UNEXPECTED_SAFE_CALL!>?.<!>f()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package
|
||||
|
||||
public open class A {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final fun f(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class B : A {
|
||||
public constructor B()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final override /*1*/ /*fake_override*/ fun f(): kotlin.Unit
|
||||
public final fun g(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
Reference in New Issue
Block a user