JS: prohibit referencing noImpl property from non-external declarations. See KT-15306

This commit is contained in:
Alexey Andreev
2016-12-29 19:21:22 +03:00
parent 199790276b
commit daac24b62e
7 changed files with 102 additions and 1 deletions
@@ -0,0 +1,29 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER, -UNREACHABLE_CODE
val prop: String = <!CALL_TO_NO_IMPL_FROM_NON_EXTERNAL_DECLARATION!>noImpl<!>
val prop2: String
get() = <!CALL_TO_NO_IMPL_FROM_NON_EXTERNAL_DECLARATION!>noImpl<!>
fun foo(x: Int, y: String = <!CALL_TO_NO_IMPL_FROM_NON_EXTERNAL_DECLARATION!>noImpl<!>) {
println("Hello")
println("world")
object {
fun bar(): Any = <!CALL_TO_NO_IMPL_FROM_NON_EXTERNAL_DECLARATION!>noImpl<!>
}
listOf<String>()
.map<String, String> { <!CALL_TO_NO_IMPL_FROM_NON_EXTERNAL_DECLARATION!>noImpl<!> }
.filter(fun(x: String): Boolean { <!CALL_TO_NO_IMPL_FROM_NON_EXTERNAL_DECLARATION!>noImpl<!> })
<!CALL_TO_NO_IMPL_FROM_NON_EXTERNAL_DECLARATION!>noImpl<!>
}
open class A(val x: Int)
open class B() : A(<!CALL_TO_NO_IMPL_FROM_NON_EXTERNAL_DECLARATION!>noImpl<!>) {
constructor(y: String) : this()
constructor(y: String, z: String) : this(y + z + <!CALL_TO_NO_IMPL_FROM_NON_EXTERNAL_DECLARATION!>noImpl<!>)
}