FIR: Add test for constructor

This commit is contained in:
Simon Ogorodnik
2019-03-18 21:50:31 +03:00
parent 5aa783a961
commit 33b44870d6
3 changed files with 27 additions and 0 deletions
@@ -0,0 +1,7 @@
class C {
fun create() = C()
}
fun foo() = C()
fun bar() = foo().create()
@@ -0,0 +1,15 @@
FILE: constructor.kt
public final class C {
public constructor(): super<R|kotlin/Any|>()
public final fun create(): R|C| {
^create R|/C.C|()
}
}
public final fun foo(): R|C| {
^foo R|/C.C|()
}
public final fun bar(): R|C| {
^bar R|/foo|().R|/C.create|()
}
@@ -159,6 +159,11 @@ public class FirResolveTestCaseGenerated extends AbstractFirResolveTestCase {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/fir/resolve/testData/resolve/expresssions"), Pattern.compile("^([^.]+)\\.kt$"), TargetBackend.ANY, true);
}
@TestMetadata("constructor.kt")
public void testConstructor() throws Exception {
runTest("compiler/fir/resolve/testData/resolve/expresssions/constructor.kt");
}
@TestMetadata("dispatchReceiver.kt")
public void testDispatchReceiver() throws Exception {
runTest("compiler/fir/resolve/testData/resolve/expresssions/dispatchReceiver.kt");