K2: support ForbidInferringTypeVariablesIntoEmptyIntersection on/off
This commit is contained in:
committed by
Space Team
parent
f7544aff62
commit
b64cb67370
@@ -1,25 +0,0 @@
|
||||
// !LANGUAGE: +ForbidInferringTypeVariablesIntoEmptyIntersection
|
||||
// FILE: ObjectNode.java
|
||||
|
||||
public interface ObjectNode {
|
||||
<T extends JsonNode> T set(String fieldName, JsonNode value);
|
||||
}
|
||||
|
||||
// FILE: JsonNode.java
|
||||
|
||||
public class JsonNode
|
||||
|
||||
// FILE: test.kt
|
||||
|
||||
interface JsonObject
|
||||
class SomeJsonObject() : JsonObject
|
||||
|
||||
fun String.put(value: JsonObject?, node: ObjectNode) {
|
||||
<!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION!>when (value) {
|
||||
null -> node.set(this, null)
|
||||
is SomeJsonObject -> Unit
|
||||
else -> TODO()
|
||||
}<!>
|
||||
}
|
||||
|
||||
fun TODO(): Nothing = null!!
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: +ForbidInferringTypeVariablesIntoEmptyIntersection
|
||||
// FILE: ObjectNode.java
|
||||
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
// !LANGUAGE: -ForbidInferringTypeVariablesIntoEmptyIntersection
|
||||
// FILE: ObjectNode.java
|
||||
|
||||
public interface ObjectNode {
|
||||
<T extends JsonNode> T set(String fieldName, JsonNode value);
|
||||
}
|
||||
|
||||
// FILE: JsonNode.java
|
||||
|
||||
public class JsonNode
|
||||
|
||||
// FILE: test.kt
|
||||
|
||||
interface JsonObject
|
||||
class SomeJsonObject() : JsonObject
|
||||
|
||||
fun String.put(value: JsonObject?, node: ObjectNode) {
|
||||
<!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION!>when (value) {
|
||||
null -> node.set(this, null)
|
||||
is SomeJsonObject -> Unit
|
||||
else -> TODO()
|
||||
}<!>
|
||||
}
|
||||
|
||||
fun TODO(): Nothing = null!!
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: -ForbidInferringTypeVariablesIntoEmptyIntersection
|
||||
// FILE: ObjectNode.java
|
||||
|
||||
|
||||
Reference in New Issue
Block a user