[FE] Erase type parameters of super types during intersection type emptiness check as well
This commit is contained in:
committed by
teamcity
parent
0f1d212fc5
commit
fb76d819f0
-41
@@ -1,41 +0,0 @@
|
||||
// IGNORE_BACKEND: WASM
|
||||
// WASM_MUTE_REASON: IGNORED_IN_JS
|
||||
// IGNORE_BACKEND: JS, JS_IR
|
||||
// IGNORE_BACKEND: JS_IR_ES6
|
||||
|
||||
fun interface KRunnable {
|
||||
fun invoke()
|
||||
}
|
||||
|
||||
fun interface KBoolean {
|
||||
fun invoke(b: Boolean)
|
||||
}
|
||||
|
||||
fun useFunInterface(fn: KRunnable) {
|
||||
fn.invoke()
|
||||
}
|
||||
fun useFunInterfacePredicate(fn: KBoolean) {
|
||||
fn.invoke(true)
|
||||
}
|
||||
|
||||
fun <T> testIntersection(x: T) where T : () -> Unit, T : (Boolean) -> Unit {
|
||||
useFunInterface(x)
|
||||
useFunInterfacePredicate(x)
|
||||
}
|
||||
|
||||
var result = ""
|
||||
|
||||
object Test : () -> Unit, (Boolean) -> Unit {
|
||||
override fun invoke() {
|
||||
result += "O"
|
||||
}
|
||||
|
||||
override fun invoke(p1: Boolean) {
|
||||
if (p1) result += "K"
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
<!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION!>testIntersection<!>(Test)
|
||||
return result
|
||||
}
|
||||
-41
@@ -1,41 +0,0 @@
|
||||
// IGNORE_BACKEND: WASM
|
||||
// WASM_MUTE_REASON: IGNORED_IN_JS
|
||||
// IGNORE_BACKEND: JS, JS_IR
|
||||
// IGNORE_BACKEND: JS_IR_ES6
|
||||
|
||||
fun interface KRunnable {
|
||||
fun invoke()
|
||||
}
|
||||
|
||||
fun interface KBoolean {
|
||||
fun invoke(b: Boolean)
|
||||
}
|
||||
|
||||
fun useFunInterface(fn: KRunnable) {
|
||||
fn.invoke()
|
||||
}
|
||||
fun useFunInterfacePredicate(fn: KBoolean) {
|
||||
fn.invoke(true)
|
||||
}
|
||||
|
||||
fun <T> testIntersection(x: T) where T : () -> Unit, T : (Boolean) -> Unit {
|
||||
useFunInterface(x)
|
||||
useFunInterfacePredicate(x)
|
||||
}
|
||||
|
||||
var result = ""
|
||||
|
||||
object Test : () -> Unit, (Boolean) -> Unit {
|
||||
override fun invoke() {
|
||||
result += "O"
|
||||
}
|
||||
|
||||
override fun invoke(p1: Boolean) {
|
||||
if (p1) result += "K"
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
<!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION_WARNING!>testIntersection<!>(Test)
|
||||
return result
|
||||
}
|
||||
-30
@@ -1,30 +0,0 @@
|
||||
package
|
||||
|
||||
public var result: kotlin.String
|
||||
public fun box(): kotlin.String
|
||||
public fun </*0*/ T : () -> kotlin.Unit> testIntersection(/*0*/ x: T): kotlin.Unit where T : (kotlin.Boolean) -> kotlin.Unit
|
||||
public fun useFunInterface(/*0*/ fn: KRunnable): kotlin.Unit
|
||||
public fun useFunInterfacePredicate(/*0*/ fn: KBoolean): kotlin.Unit
|
||||
|
||||
public fun interface KBoolean {
|
||||
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 fun invoke(/*0*/ b: kotlin.Boolean): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public fun interface KRunnable {
|
||||
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 fun invoke(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public object Test : () -> kotlin.Unit, (kotlin.Boolean) -> kotlin.Unit {
|
||||
private constructor Test()
|
||||
public open override /*2*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*2*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ fun invoke(): kotlin.Unit
|
||||
public open override /*1*/ fun invoke(/*0*/ p1: kotlin.Boolean): kotlin.Unit
|
||||
public open override /*2*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
-41
@@ -1,41 +0,0 @@
|
||||
// !LANGUAGE: +SuspendConversion
|
||||
// WITH_STDLIB
|
||||
// WITH_COROUTINES
|
||||
// IGNORE_BACKEND: JVM, NATIVE, JS, JS_IR
|
||||
// IGNORE_BACKEND: JS_IR_ES6
|
||||
// IGNORE_LIGHT_ANALYSIS
|
||||
// IGNORE_BACKEND: WASM
|
||||
// WASM_MUTE_REASON: IGNORED_IN_JS
|
||||
|
||||
import helpers.*
|
||||
import kotlin.coroutines.*
|
||||
import kotlin.coroutines.intrinsics.*
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
|
||||
suspend fun useSuspendFun(fn : suspend () -> String) = fn()
|
||||
suspend fun useSuspendFunInt(fn: suspend (Int) -> String) = fn(42)
|
||||
|
||||
suspend fun <T> testIntersection(x: T): String where T : () -> String, T : (Int) -> String {
|
||||
val a = useSuspendFun(x)
|
||||
val b = useSuspendFunInt(x)
|
||||
return a + b
|
||||
}
|
||||
|
||||
class Test : () -> String, (Int) -> String {
|
||||
override fun invoke(): String = "OKEmpty"
|
||||
override fun invoke(p: Int) = "OK$p"
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
var test = "Failed"
|
||||
builder {
|
||||
test = <!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION!>testIntersection<!>(Test())
|
||||
}
|
||||
|
||||
if (test != "OKEmptyOK42") return "failed: $test"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
-41
@@ -1,41 +0,0 @@
|
||||
// !LANGUAGE: +SuspendConversion
|
||||
// WITH_STDLIB
|
||||
// WITH_COROUTINES
|
||||
// IGNORE_BACKEND: JVM, NATIVE, JS, JS_IR
|
||||
// IGNORE_BACKEND: JS_IR_ES6
|
||||
// IGNORE_LIGHT_ANALYSIS
|
||||
// IGNORE_BACKEND: WASM
|
||||
// WASM_MUTE_REASON: IGNORED_IN_JS
|
||||
|
||||
import helpers.*
|
||||
import kotlin.coroutines.*
|
||||
import kotlin.coroutines.intrinsics.*
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
|
||||
suspend fun useSuspendFun(fn : suspend () -> String) = fn()
|
||||
suspend fun useSuspendFunInt(fn: suspend (Int) -> String) = fn(42)
|
||||
|
||||
suspend fun <T> testIntersection(x: T): String where T : () -> String, T : (Int) -> String {
|
||||
val a = useSuspendFun(x)
|
||||
val b = useSuspendFunInt(x)
|
||||
return a + b
|
||||
}
|
||||
|
||||
class Test : () -> String, (Int) -> String {
|
||||
override fun invoke(): String = "OKEmpty"
|
||||
override fun invoke(p: Int) = "OK$p"
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
var test = "Failed"
|
||||
builder {
|
||||
test = <!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION_WARNING!>testIntersection<!>(Test())
|
||||
}
|
||||
|
||||
if (test != "OKEmptyOK42") return "failed: $test"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
package
|
||||
|
||||
public fun box(): kotlin.String
|
||||
public fun builder(/*0*/ c: suspend () -> kotlin.Unit): kotlin.Unit
|
||||
public suspend fun </*0*/ T : () -> kotlin.String> testIntersection(/*0*/ x: T): kotlin.String where T : (kotlin.Int) -> kotlin.String
|
||||
public suspend fun useSuspendFun(/*0*/ fn: suspend () -> kotlin.String): kotlin.String
|
||||
public suspend fun useSuspendFunInt(/*0*/ fn: suspend (kotlin.Int) -> kotlin.String): kotlin.String
|
||||
|
||||
public final class Test : () -> kotlin.String, (kotlin.Int) -> kotlin.String {
|
||||
public constructor Test()
|
||||
public open override /*2*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*2*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ fun invoke(): kotlin.String
|
||||
public open override /*1*/ fun invoke(/*0*/ p: kotlin.Int): kotlin.String
|
||||
public open override /*2*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
Reference in New Issue
Block a user