Add tests for KT-45308

This commit is contained in:
Dmitry Petrov
2021-04-21 13:51:16 +03:00
committed by TeamCityServer
parent f228c3bb04
commit 732405895f
14 changed files with 138 additions and 0 deletions
@@ -40636,6 +40636,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
runTest("compiler/testData/codegen/box/typealias/kt15109.kt");
}
@Test
@TestMetadata("kt45308.kt")
public void testKt45308() throws Exception {
runTest("compiler/testData/codegen/box/typealias/kt45308.kt");
}
@Test
@TestMetadata("objectLiteralConstructor.kt")
public void testObjectLiteralConstructor() throws Exception {
@@ -440,6 +440,12 @@ public class Fir2IrTextTestGenerated extends AbstractFir2IrTextTest {
runTest("compiler/testData/ir/irText/declarations/kt35550.kt");
}
@Test
@TestMetadata("kt45308.kt")
public void testKt45308() throws Exception {
runTest("compiler/testData/ir/irText/declarations/kt45308.kt");
}
@Test
@TestMetadata("localClassWithOverrides.kt")
public void testLocalClassWithOverrides() throws Exception {
+19
View File
@@ -0,0 +1,19 @@
// MODULE: a
// FILE: a.kt
package a
typealias A = String
// MODULE: b(a)
// FILE: b.kt
package b
import a.A
fun foo(f: () -> A): A = f()
// MODULE: main(b)
// FILE: c.kt
import b.foo
fun box(): String = foo { "OK" }
@@ -0,0 +1,22 @@
Module: a
FILE fqName:a fileName:/a.kt
TYPEALIAS name:A visibility:public expandedType:kotlin.String
Module: b
FILE fqName:b fileName:/b.kt
FUN name:foo visibility:public modality:FINAL <> (f:kotlin.Function0<kotlin.String>) returnType:kotlin.String
VALUE_PARAMETER name:f index:0 type:kotlin.Function0<kotlin.String>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun foo (f: kotlin.Function0<kotlin.String>): kotlin.String declared in b'
CALL 'public abstract fun invoke (): R of kotlin.Function0 [operator] declared in kotlin.Function0' type=kotlin.String origin=INVOKE
$this: GET_VAR 'f: kotlin.Function0<kotlin.String> declared in b.foo' type=kotlin.Function0<kotlin.String> origin=VARIABLE_AS_FUNCTION
Module: c
FILE fqName:<root> fileName:/c.kt
FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
CALL 'public final fun foo (f: kotlin.Function0<kotlin.String>): kotlin.String declared in b' type=kotlin.String origin=null
f: FUN_EXPR type=kotlin.Function0<kotlin.String> origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> () returnType:kotlin.String
BLOCK_BODY
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): kotlin.String declared in <root>.box'
CONST String type=kotlin.String value="OK"
+20
View File
@@ -0,0 +1,20 @@
// SKIP_KT_DUMP
// MODULE: a
// FILE: a.kt
package a
typealias A = String
// MODULE: b(a)
// FILE: b.kt
package b
import a.A
fun foo(f: () -> A): A = f()
// MODULE: c(b)
// FILE: c.kt
import b.foo
fun box(): String = foo { "OK" }
+22
View File
@@ -0,0 +1,22 @@
Module: a
FILE fqName:a fileName:/a.kt
TYPEALIAS name:A visibility:public expandedType:kotlin.String
Module: b
FILE fqName:b fileName:/b.kt
FUN name:foo visibility:public modality:FINAL <> (f:kotlin.Function0<kotlin.String{ a.A }>) returnType:kotlin.String{ a.A }
VALUE_PARAMETER name:f index:0 type:kotlin.Function0<kotlin.String{ a.A }>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun foo (f: kotlin.Function0<kotlin.String{ a.A }>): kotlin.String{ a.A } declared in b'
CALL 'public abstract fun invoke (): R of kotlin.Function0 [operator] declared in kotlin.Function0' type=kotlin.String{ a.A } origin=INVOKE
$this: GET_VAR 'f: kotlin.Function0<kotlin.String{ a.A }> declared in b.foo' type=kotlin.Function0<kotlin.String{ a.A }> origin=VARIABLE_AS_FUNCTION
Module: c
FILE fqName:<root> fileName:/c.kt
FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
CALL 'public final fun foo (f: kotlin.Function0<kotlin.String{ a.A }>): kotlin.String{ a.A } declared in b' type=kotlin.String{ a.A } origin=null
f: FUN_EXPR type=kotlin.Function0<kotlin.String{ a.A }> origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> () returnType:kotlin.String{ a.A }
BLOCK_BODY
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): kotlin.String{ a.A } declared in <root>.box'
CONST String type=kotlin.String value="OK"
@@ -40612,6 +40612,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/typealias/kt15109.kt");
}
@Test
@TestMetadata("kt45308.kt")
public void testKt45308() throws Exception {
runTest("compiler/testData/codegen/box/typealias/kt45308.kt");
}
@Test
@TestMetadata("objectLiteralConstructor.kt")
public void testObjectLiteralConstructor() throws Exception {
@@ -40636,6 +40636,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/typealias/kt15109.kt");
}
@Test
@TestMetadata("kt45308.kt")
public void testKt45308() throws Exception {
runTest("compiler/testData/codegen/box/typealias/kt45308.kt");
}
@Test
@TestMetadata("objectLiteralConstructor.kt")
public void testObjectLiteralConstructor() throws Exception {
@@ -440,6 +440,12 @@ public class IrTextTestGenerated extends AbstractIrTextTest {
runTest("compiler/testData/ir/irText/declarations/kt35550.kt");
}
@Test
@TestMetadata("kt45308.kt")
public void testKt45308() throws Exception {
runTest("compiler/testData/ir/irText/declarations/kt45308.kt");
}
@Test
@TestMetadata("localClassWithOverrides.kt")
public void testLocalClassWithOverrides() throws Exception {
@@ -32620,6 +32620,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
runTest("compiler/testData/codegen/box/typealias/kt15109.kt");
}
@TestMetadata("kt45308.kt")
public void testKt45308() throws Exception {
runTest("compiler/testData/codegen/box/typealias/kt45308.kt");
}
@TestMetadata("objectLiteralConstructor.kt")
public void testObjectLiteralConstructor() throws Exception {
runTest("compiler/testData/codegen/box/typealias/objectLiteralConstructor.kt");
@@ -27375,6 +27375,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
runTest("compiler/testData/codegen/box/typealias/kt15109.kt");
}
@TestMetadata("kt45308.kt")
public void testKt45308() throws Exception {
runTest("compiler/testData/codegen/box/typealias/kt45308.kt");
}
@TestMetadata("objectLiteralConstructor.kt")
public void testObjectLiteralConstructor() throws Exception {
runTest("compiler/testData/codegen/box/typealias/objectLiteralConstructor.kt");
@@ -26786,6 +26786,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/typealias/kt15109.kt");
}
@TestMetadata("kt45308.kt")
public void testKt45308() throws Exception {
runTest("compiler/testData/codegen/box/typealias/kt45308.kt");
}
@TestMetadata("objectLiteralConstructor.kt")
public void testObjectLiteralConstructor() throws Exception {
runTest("compiler/testData/codegen/box/typealias/objectLiteralConstructor.kt");
@@ -26746,6 +26746,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/typealias/kt15109.kt");
}
@TestMetadata("kt45308.kt")
public void testKt45308() throws Exception {
runTest("compiler/testData/codegen/box/typealias/kt45308.kt");
}
@TestMetadata("objectLiteralConstructor.kt")
public void testObjectLiteralConstructor() throws Exception {
runTest("compiler/testData/codegen/box/typealias/objectLiteralConstructor.kt");
@@ -15044,6 +15044,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
runTest("compiler/testData/codegen/box/typealias/kt15109.kt");
}
@TestMetadata("kt45308.kt")
public void testKt45308() throws Exception {
runTest("compiler/testData/codegen/box/typealias/kt45308.kt");
}
@TestMetadata("objectLiteralConstructor.kt")
public void testObjectLiteralConstructor() throws Exception {
runTest("compiler/testData/codegen/box/typealias/objectLiteralConstructor.kt");