From 0f59622a440f482facf023e30190cfd4e28f4fd7 Mon Sep 17 00:00:00 2001 From: Valentin Kipyatkov Date: Fri, 21 Nov 2014 15:56:05 +0300 Subject: [PATCH] Checked that partial body resolve works for property delegating --- .../partialBodyResolve/PropertyByDelegate.dump | 13 +++++++++++++ .../partialBodyResolve/PropertyByDelegate.kt | 11 +++++++++++ .../resolve/PartialBodyResolveTestGenerated.java | 6 ++++++ 3 files changed, 30 insertions(+) create mode 100644 idea/testData/resolve/partialBodyResolve/PropertyByDelegate.dump create mode 100644 idea/testData/resolve/partialBodyResolve/PropertyByDelegate.kt diff --git a/idea/testData/resolve/partialBodyResolve/PropertyByDelegate.dump b/idea/testData/resolve/partialBodyResolve/PropertyByDelegate.dump new file mode 100644 index 00000000000..269b3f9c1ec --- /dev/null +++ b/idea/testData/resolve/partialBodyResolve/PropertyByDelegate.dump @@ -0,0 +1,13 @@ +Resolve target: fun g(): kotlin.Int +---------------------------------------------- +import kotlin.properties.Delegates + +val prop: Int by Delegates.lazy { + // STATEMENT DELETED: print(1) + val v = f() + g() + v + 1 +} + +fun f(): Int = 1 +fun g(): Int = 2 diff --git a/idea/testData/resolve/partialBodyResolve/PropertyByDelegate.kt b/idea/testData/resolve/partialBodyResolve/PropertyByDelegate.kt new file mode 100644 index 00000000000..f9eec9896d4 --- /dev/null +++ b/idea/testData/resolve/partialBodyResolve/PropertyByDelegate.kt @@ -0,0 +1,11 @@ +import kotlin.properties.Delegates + +val prop: Int by Delegates.lazy { + print(1) + val v = f() + g() + v + 1 +} + +fun f(): Int = 1 +fun g(): Int = 2 \ No newline at end of file diff --git a/idea/tests/org/jetbrains/jet/resolve/PartialBodyResolveTestGenerated.java b/idea/tests/org/jetbrains/jet/resolve/PartialBodyResolveTestGenerated.java index 1afb4ec5a9b..b9b061908d9 100644 --- a/idea/tests/org/jetbrains/jet/resolve/PartialBodyResolveTestGenerated.java +++ b/idea/tests/org/jetbrains/jet/resolve/PartialBodyResolveTestGenerated.java @@ -318,6 +318,12 @@ public class PartialBodyResolveTestGenerated extends AbstractPartialBodyResolveT doTest(fileName); } + @TestMetadata("PropertyByDelegate.kt") + public void testPropertyByDelegate() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/resolve/partialBodyResolve/PropertyByDelegate.kt"); + doTest(fileName); + } + @TestMetadata("ReturnLambda.kt") public void testReturnLambda() throws Exception { String fileName = JetTestUtils.navigationMetadata("idea/testData/resolve/partialBodyResolve/ReturnLambda.kt");