[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) {
|
return when (this) {
|
||||||
is IrType -> substitute(typeSubstitutionMap)
|
is IrType -> substitute(typeSubstitutionMap)
|
||||||
is IrTypeProjection -> type.substitute(typeSubstitutionMap)
|
is IrTypeProjection -> type.substitute(typeSubstitutionMap)
|
||||||
|
is IrStarProjection -> context.irBuiltIns.anyNType
|
||||||
else -> error("Unexpected ir type argument")
|
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 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 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 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
|
// SKIP_NODE_JS
|
||||||
// INFER_MAIN_MODULE
|
// INFER_MAIN_MODULE
|
||||||
// MODULE: JS_TESTS
|
// MODULE: JS_TESTS
|
||||||
|
// WITH_STDLIB
|
||||||
// FILE: functions.kt
|
// FILE: functions.kt
|
||||||
|
|
||||||
package foo
|
package foo
|
||||||
@@ -61,3 +62,9 @@ fun <A, B, C, D, E> generic3(a: A, b: B, c: C, d: D): E? = null
|
|||||||
inline fun inlineFun(x: Int, callback: (Int) -> Unit) {
|
inline fun inlineFun(x: Int, callback: (Int) -> Unit) {
|
||||||
callback(x)
|
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 varargWithComplexType = JS_TESTS.foo.varargWithComplexType;
|
||||||
var genericWithConstraint = JS_TESTS.foo.genericWithConstraint;
|
var genericWithConstraint = JS_TESTS.foo.genericWithConstraint;
|
||||||
var genericWithMultipleConstraints = JS_TESTS.foo.genericWithMultipleConstraints;
|
var genericWithMultipleConstraints = JS_TESTS.foo.genericWithMultipleConstraints;
|
||||||
|
var formatList = JS_TESTS.foo.formatList;
|
||||||
|
var createList = JS_TESTS.foo.createList;
|
||||||
function assert(condition) {
|
function assert(condition) {
|
||||||
if (!condition) {
|
if (!condition) {
|
||||||
throw "Assertion failed";
|
throw "Assertion failed";
|
||||||
@@ -55,5 +57,6 @@ function box() {
|
|||||||
var result = 0;
|
var result = 0;
|
||||||
inlineFun(10, function (x) { result = x; });
|
inlineFun(10, function (x) { result = x; });
|
||||||
assert(result === 10);
|
assert(result === 10);
|
||||||
|
assert(formatList(createList()) === "1, 2, 3");
|
||||||
return "OK";
|
return "OK";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,8 @@ import varargWithOtherParameters = JS_TESTS.foo.varargWithOtherParameters;
|
|||||||
import varargWithComplexType = JS_TESTS.foo.varargWithComplexType;
|
import varargWithComplexType = JS_TESTS.foo.varargWithComplexType;
|
||||||
import genericWithConstraint = JS_TESTS.foo.genericWithConstraint;
|
import genericWithConstraint = JS_TESTS.foo.genericWithConstraint;
|
||||||
import genericWithMultipleConstraints = JS_TESTS.foo.genericWithMultipleConstraints;
|
import genericWithMultipleConstraints = JS_TESTS.foo.genericWithMultipleConstraints;
|
||||||
|
import formatList = JS_TESTS.foo.formatList;
|
||||||
|
import createList = JS_TESTS.foo.createList;
|
||||||
function assert(condition: boolean) {
|
function assert(condition: boolean) {
|
||||||
if (!condition) {
|
if (!condition) {
|
||||||
throw "Assertion failed";
|
throw "Assertion failed";
|
||||||
@@ -54,5 +55,7 @@ function box(): string {
|
|||||||
inlineFun(10, x => { result = x; });
|
inlineFun(10, x => { result = x; });
|
||||||
assert(result === 10);
|
assert(result === 10);
|
||||||
|
|
||||||
|
assert(formatList(createList()) === "1, 2, 3")
|
||||||
|
|
||||||
return "OK";
|
return "OK";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user