Add test for KT-17479 looks like #KT-17479 Fixed

(after CAPTURED_MEMBER_VAL_INITIALIZATION introduction)
This commit is contained in:
Mikhail Glukhikh
2017-04-28 13:21:34 +03:00
committed by Mikhail Glukhikh
parent 28283bad3e
commit b5d0de7c3f
3 changed files with 32 additions and 0 deletions
@@ -0,0 +1,17 @@
// See KT-17479
class Test {
val str: String
init {
run {
<!CAPTURED_MEMBER_VAL_INITIALIZATION!>this@Test.str<!> = "A"
}
run {
// Not sure do we need diagnostic also here
this@Test.str = "B"
}
str = "C"
}
}
@@ -0,0 +1,9 @@
package
public final class Test {
public constructor Test()
public final val str: kotlin.String
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
@@ -3790,6 +3790,12 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
doTest(fileName);
}
@TestMetadata("initializationInLocalViaExplicitThis.kt")
public void testInitializationInLocalViaExplicitThis() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/controlFlowAnalysis/initializationInLocalViaExplicitThis.kt");
doTest(fileName);
}
@TestMetadata("kt1001.kt")
public void testKt1001() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1001.kt");