[K/JS] add miss StartProjection for the substitution inside lowerings ^KT-55852 Fixed
This commit is contained in:
+1
@@ -66,6 +66,7 @@ class TransitiveExportCollector(val context: JsIrBackendContext) {
|
||||
return when (this) {
|
||||
is IrType -> substitute(typeSubstitutionMap)
|
||||
is IrTypeProjection -> type.substitute(typeSubstitutionMap)
|
||||
is IrStarProjection -> context.irBuiltIns.anyNType
|
||||
else -> error("Unexpected ir type argument")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,5 +18,7 @@ declare namespace JS_TESTS {
|
||||
function genericWithMultipleConstraints<T extends unknown/* kotlin.Comparable<T> */ & foo.SomeExternalInterface & Error>(x: T): T;
|
||||
function generic3<A, B, C, D, E>(a: A, b: B, c: C, d: D): Nullable<E>;
|
||||
function inlineFun(x: number, callback: (p0: number) => void): void;
|
||||
function formatList(value: any/* kotlin.collections.List<UnknownType *> */): string;
|
||||
function createList(): any/* kotlin.collections.List<UnknownType *> */;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
// SKIP_NODE_JS
|
||||
// INFER_MAIN_MODULE
|
||||
// MODULE: JS_TESTS
|
||||
// WITH_STDLIB
|
||||
// FILE: functions.kt
|
||||
|
||||
package foo
|
||||
@@ -60,4 +61,10 @@ fun <A, B, C, D, E> generic3(a: A, b: B, c: C, d: D): E? = null
|
||||
@JsExport
|
||||
inline fun inlineFun(x: Int, callback: (Int) -> Unit) {
|
||||
callback(x)
|
||||
}
|
||||
}
|
||||
|
||||
@JsExport
|
||||
fun formatList(value: List<*>): String = value.joinToString(", ") { it.toString() }
|
||||
|
||||
@JsExport
|
||||
fun createList(): List<*> = listOf(1, 2, 3)
|
||||
|
||||
@@ -23,6 +23,8 @@ var varargWithOtherParameters = JS_TESTS.foo.varargWithOtherParameters;
|
||||
var varargWithComplexType = JS_TESTS.foo.varargWithComplexType;
|
||||
var genericWithConstraint = JS_TESTS.foo.genericWithConstraint;
|
||||
var genericWithMultipleConstraints = JS_TESTS.foo.genericWithMultipleConstraints;
|
||||
var formatList = JS_TESTS.foo.formatList;
|
||||
var createList = JS_TESTS.foo.createList;
|
||||
function assert(condition) {
|
||||
if (!condition) {
|
||||
throw "Assertion failed";
|
||||
@@ -55,5 +57,6 @@ function box() {
|
||||
var result = 0;
|
||||
inlineFun(10, function (x) { result = x; });
|
||||
assert(result === 10);
|
||||
assert(formatList(createList()) === "1, 2, 3");
|
||||
return "OK";
|
||||
}
|
||||
|
||||
@@ -11,7 +11,8 @@ import varargWithOtherParameters = JS_TESTS.foo.varargWithOtherParameters;
|
||||
import varargWithComplexType = JS_TESTS.foo.varargWithComplexType;
|
||||
import genericWithConstraint = JS_TESTS.foo.genericWithConstraint;
|
||||
import genericWithMultipleConstraints = JS_TESTS.foo.genericWithMultipleConstraints;
|
||||
|
||||
import formatList = JS_TESTS.foo.formatList;
|
||||
import createList = JS_TESTS.foo.createList;
|
||||
function assert(condition: boolean) {
|
||||
if (!condition) {
|
||||
throw "Assertion failed";
|
||||
@@ -54,5 +55,7 @@ function box(): string {
|
||||
inlineFun(10, x => { result = x; });
|
||||
assert(result === 10);
|
||||
|
||||
assert(formatList(createList()) === "1, 2, 3")
|
||||
|
||||
return "OK";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user