[FIR] Support CHECK_TYPE in K2 JS tests
^KT-60056
This commit is contained in:
committed by
Space Team
parent
69fba8d33b
commit
f52648af5f
Vendored
-34
@@ -1,34 +0,0 @@
|
|||||||
// !DIAGNOSTICS: -UNUSED_ANONYMOUS_PARAMETER
|
|
||||||
// !CHECK_TYPE
|
|
||||||
|
|
||||||
fun test(d: dynamic) {
|
|
||||||
d.foo {}
|
|
||||||
|
|
||||||
d.foo { <!UNRESOLVED_REFERENCE!>it<!> }
|
|
||||||
|
|
||||||
d.foo { x -> x.bar() }
|
|
||||||
|
|
||||||
d.foo { x: Int -> "" }
|
|
||||||
|
|
||||||
d.foo { x, y -> "" }
|
|
||||||
|
|
||||||
d.foo { x: String, y: Int -> "" }
|
|
||||||
|
|
||||||
d.foo { x, y: Int -> "" }
|
|
||||||
|
|
||||||
d.foo({})
|
|
||||||
|
|
||||||
d.foo({ x -> })
|
|
||||||
|
|
||||||
d.foo(<!UNRESOLVED_REFERENCE!>checkSubtype<!><(Int) -> Unit>({ x -> }))
|
|
||||||
|
|
||||||
d.foo(label@ { x -> })
|
|
||||||
|
|
||||||
d.foo(label@ ({ x, y -> }))
|
|
||||||
|
|
||||||
d.foo((label@ ({ x, y: Int -> })))
|
|
||||||
|
|
||||||
d.foo(({ x -> }))
|
|
||||||
|
|
||||||
d.foo((({ x -> })))
|
|
||||||
}
|
|
||||||
+1
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
// !DIAGNOSTICS: -UNUSED_ANONYMOUS_PARAMETER
|
// !DIAGNOSTICS: -UNUSED_ANONYMOUS_PARAMETER
|
||||||
// !CHECK_TYPE
|
// !CHECK_TYPE
|
||||||
|
|
||||||
|
|||||||
-23
@@ -1,23 +0,0 @@
|
|||||||
// !CHECK_TYPE
|
|
||||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
|
||||||
|
|
||||||
fun dyn(d: dynamic) {}
|
|
||||||
|
|
||||||
fun foo(d: dynamic): String = ""
|
|
||||||
fun foo(d: Int): Int = 1
|
|
||||||
|
|
||||||
fun nothing(d: dynamic): Int = 1
|
|
||||||
fun nothing(d: Nothing): String = ""
|
|
||||||
|
|
||||||
fun test(d: dynamic) {
|
|
||||||
dyn(1)
|
|
||||||
dyn("")
|
|
||||||
|
|
||||||
foo(1).<!UNRESOLVED_REFERENCE!>checkType<!> { <!UNRESOLVED_REFERENCE!>_<!><Int>() }
|
|
||||||
foo("").<!UNRESOLVED_REFERENCE!>checkType<!> { <!UNRESOLVED_REFERENCE!>_<!><String>() }
|
|
||||||
|
|
||||||
// Checking specificity of `dynamic` vs `Nothing`
|
|
||||||
nothing(d).<!UNRESOLVED_REFERENCE!>checkType<!> { <!UNRESOLVED_REFERENCE!>_<!><String>() }
|
|
||||||
nothing("").<!UNRESOLVED_REFERENCE!>checkType<!> { <!UNRESOLVED_REFERENCE!>_<!><Int>() }
|
|
||||||
@Suppress("UNREACHABLE_CODE") nothing(null!!).<!UNRESOLVED_REFERENCE!>checkType<!> { <!UNRESOLVED_REFERENCE!>_<!><String>() }
|
|
||||||
}
|
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
// !CHECK_TYPE
|
// !CHECK_TYPE
|
||||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import org.jetbrains.kotlin.test.runners.configurationForClassicAndFirTestsAlong
|
|||||||
import org.jetbrains.kotlin.test.services.LibraryProvider
|
import org.jetbrains.kotlin.test.services.LibraryProvider
|
||||||
import org.jetbrains.kotlin.test.services.configuration.CommonEnvironmentConfigurator
|
import org.jetbrains.kotlin.test.services.configuration.CommonEnvironmentConfigurator
|
||||||
import org.jetbrains.kotlin.test.services.configuration.JsEnvironmentConfigurator
|
import org.jetbrains.kotlin.test.services.configuration.JsEnvironmentConfigurator
|
||||||
|
import org.jetbrains.kotlin.test.services.sourceProviders.AdditionalDiagnosticsSourceFilesProvider
|
||||||
import org.jetbrains.kotlin.test.services.sourceProviders.CoroutineHelpersSourceFilesProvider
|
import org.jetbrains.kotlin.test.services.sourceProviders.CoroutineHelpersSourceFilesProvider
|
||||||
|
|
||||||
abstract class AbstractFirJsDiagnosticTestBase(val parser: FirParser) : AbstractKotlinCompilerTest() {
|
abstract class AbstractFirJsDiagnosticTestBase(val parser: FirParser) : AbstractKotlinCompilerTest() {
|
||||||
@@ -58,6 +59,7 @@ abstract class AbstractFirJsDiagnosticTestBase(val parser: FirParser) : Abstract
|
|||||||
useAdditionalSourceProviders(
|
useAdditionalSourceProviders(
|
||||||
::JsAdditionalSourceProvider,
|
::JsAdditionalSourceProvider,
|
||||||
::CoroutineHelpersSourceFilesProvider,
|
::CoroutineHelpersSourceFilesProvider,
|
||||||
|
::AdditionalDiagnosticsSourceFilesProvider,
|
||||||
)
|
)
|
||||||
|
|
||||||
useAdditionalService(::LibraryProvider)
|
useAdditionalService(::LibraryProvider)
|
||||||
|
|||||||
Reference in New Issue
Block a user