Delay ForbidInferringTypeVariablesIntoEmptyIntersection to 2.*
Note: here we set sinceVersion = null for this feature. However, we plan in 1.9.* - 2.0 time frame to solve KT-56377 and to enable this feature in 2.0, the latest in 2.1.
This commit is contained in:
committed by
Space Team
parent
a3dcc2032f
commit
f7544aff62
@@ -0,0 +1,25 @@
|
||||
// !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!!
|
||||
@@ -0,0 +1,25 @@
|
||||
// !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_ERROR!>when (value) {
|
||||
null -> node.set(this, null)
|
||||
is SomeJsonObject -> Unit
|
||||
else -> TODO()
|
||||
}<!>
|
||||
}
|
||||
|
||||
fun TODO(): Nothing = null!!
|
||||
@@ -0,0 +1,32 @@
|
||||
package
|
||||
|
||||
public fun TODO(): kotlin.Nothing
|
||||
public fun kotlin.String.put(/*0*/ value: JsonObject?, /*1*/ node: ObjectNode): kotlin.Unit
|
||||
|
||||
public open class JsonNode {
|
||||
public constructor JsonNode()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public interface JsonObject {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public interface ObjectNode {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public abstract operator fun </*0*/ T : JsonNode!> set(/*0*/ fieldName: kotlin.String!, /*1*/ value: JsonNode!): T!
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class SomeJsonObject : JsonObject {
|
||||
public constructor SomeJsonObject()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
// !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!!
|
||||
@@ -0,0 +1,25 @@
|
||||
// !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_WARNING!>when (value) {
|
||||
null -> node.set(this, null)
|
||||
is SomeJsonObject -> Unit
|
||||
else -> TODO()
|
||||
}<!>
|
||||
}
|
||||
|
||||
fun TODO(): Nothing = null!!
|
||||
Reference in New Issue
Block a user