JS: chained reified function calls (KT-12527) fixed

This commit is contained in:
Anton Bannykh
2016-11-17 19:41:01 +03:00
parent a57748f4f4
commit 2f0bccfb09
5 changed files with 57 additions and 1 deletions
@@ -19112,6 +19112,12 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that.");
}
@TestMetadata("reifiedChain.kt")
public void testReifiedChain() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/reified/reifiedChain.kt");
doTest(fileName);
}
@TestMetadata("reifiedInlineFunOfObject.kt")
public void testReifiedInlineFunOfObject() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/reified/reifiedInlineFunOfObject.kt");
@@ -138,7 +138,9 @@ public final class PatternTranslator extends AbstractTranslator {
public JsExpression getIsTypeCheckCallable(@NotNull KotlinType type) {
JsExpression callable = doGetIsTypeCheckCallable(type);
if (isNullableType(type)) {
// If the type is reified, rely on the corresponding is type callable.
// Otherwise make sure that passing null yields true
if (!isReifiedTypeParameter(type) && isNullableType(type)) {
return namer().orNull(callable);
}