[FIR JS] Report CALL_TO_DEFINED_EXTERNALLY_FROM_NON_EXTERNAL_DECLARATION

This commit is contained in:
Nikolay Lunyak
2023-01-04 16:23:42 +02:00
committed by Space Team
parent 4cf8d9ffb9
commit 56285bb2d6
16 changed files with 128 additions and 38 deletions
@@ -1,29 +0,0 @@
// !DIAGNOSTICS: -UNUSED_ANONYMOUS_PARAMETER -UNUSED_PARAMETER, -UNREACHABLE_CODE
val prop: String = definedExternally
val prop2: String
get() = definedExternally
fun foo(x: Int, y: String = definedExternally) {
println("Hello")
println("world")
object {
fun bar(): Any = definedExternally
}
listOf<String>()
.map<String, String> { definedExternally }
.filter(fun(x: String): Boolean { definedExternally })
definedExternally
}
open class A(val x: Int)
open class B() : A(definedExternally) {
constructor(y: String) : this()
constructor(y: String, z: String) : this(y + z + definedExternally)
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_ANONYMOUS_PARAMETER -UNUSED_PARAMETER, -UNREACHABLE_CODE
val prop: String = <!CALL_TO_DEFINED_EXTERNALLY_FROM_NON_EXTERNAL_DECLARATION!>definedExternally<!>
@@ -27,3 +28,12 @@ open class B() : A(<!CALL_TO_DEFINED_EXTERNALLY_FROM_NON_EXTERNAL_DECLARATION!>d
constructor(y: String, z: String) : this(y + z + <!CALL_TO_DEFINED_EXTERNALLY_FROM_NON_EXTERNAL_DECLARATION!>definedExternally<!>)
}
private fun exposeClassS() = run {
class S {
inner class W {
val v: String = <!CALL_TO_DEFINED_EXTERNALLY_FROM_NON_EXTERNAL_DECLARATION!>definedExternally<!>
}
}
S()
}
@@ -2,6 +2,7 @@ package
public val prop: kotlin.String
public val prop2: kotlin.String
private fun exposeClassS(): exposeClassS.`<anonymous>`.S
public fun foo(/*0*/ x: kotlin.Int, /*1*/ y: kotlin.String = ...): kotlin.Unit
public open class A {
@@ -21,3 +22,4 @@ public open class B : A {
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}