Fix test data for empty LHS vs isInitialized
Ignore the "property imported from object" part on JS
This commit is contained in:
-11
@@ -2,9 +2,6 @@
|
|||||||
|
|
||||||
package test
|
package test
|
||||||
|
|
||||||
import kotlin.reflect.KProperty
|
|
||||||
import test.Derived.p
|
|
||||||
|
|
||||||
class Foo {
|
class Foo {
|
||||||
lateinit var p: String
|
lateinit var p: String
|
||||||
|
|
||||||
@@ -29,12 +26,6 @@ object Bar {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
open class Base(val b: Boolean)
|
|
||||||
|
|
||||||
object Derived : Base(::p.isInitialized) {
|
|
||||||
lateinit var p: String
|
|
||||||
}
|
|
||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
val foo = Foo()
|
val foo = Foo()
|
||||||
if (foo.test()) return "Fail 1"
|
if (foo.test()) return "Fail 1"
|
||||||
@@ -44,7 +35,5 @@ fun box(): String {
|
|||||||
if (bar.test()) return "Fail 3"
|
if (bar.test()) return "Fail 3"
|
||||||
if (!bar.test()) return "Fail 4"
|
if (!bar.test()) return "Fail 4"
|
||||||
|
|
||||||
if (Derived.b) return "Fail 5"
|
|
||||||
|
|
||||||
return bar.p
|
return bar.p
|
||||||
}
|
}
|
||||||
|
|||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
// WITH_RUNTIME
|
||||||
|
// IGNORE_BACKEND: JS
|
||||||
|
|
||||||
|
package test
|
||||||
|
|
||||||
|
import test.Derived.p
|
||||||
|
|
||||||
|
open class Base(val b: Boolean)
|
||||||
|
|
||||||
|
object Derived : Base(::p.isInitialized) {
|
||||||
|
lateinit var p: String
|
||||||
|
}
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
return if (Derived.b) "Fail" else "OK"
|
||||||
|
}
|
||||||
+6
@@ -13962,6 +13962,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("propertyImportedFromObject.kt")
|
||||||
|
public void testPropertyImportedFromObject() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/properties/lateinit/isInitializedAndDeinitialize/propertyImportedFromObject.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("sideEffects.kt")
|
@TestMetadata("sideEffects.kt")
|
||||||
public void testSideEffects() throws Exception {
|
public void testSideEffects() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/properties/lateinit/isInitializedAndDeinitialize/sideEffects.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/properties/lateinit/isInitializedAndDeinitialize/sideEffects.kt");
|
||||||
|
|||||||
@@ -13962,6 +13962,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("propertyImportedFromObject.kt")
|
||||||
|
public void testPropertyImportedFromObject() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/properties/lateinit/isInitializedAndDeinitialize/propertyImportedFromObject.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("sideEffects.kt")
|
@TestMetadata("sideEffects.kt")
|
||||||
public void testSideEffects() throws Exception {
|
public void testSideEffects() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/properties/lateinit/isInitializedAndDeinitialize/sideEffects.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/properties/lateinit/isInitializedAndDeinitialize/sideEffects.kt");
|
||||||
|
|||||||
@@ -13962,6 +13962,12 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("propertyImportedFromObject.kt")
|
||||||
|
public void testPropertyImportedFromObject() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/properties/lateinit/isInitializedAndDeinitialize/propertyImportedFromObject.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("sideEffects.kt")
|
@TestMetadata("sideEffects.kt")
|
||||||
public void testSideEffects() throws Exception {
|
public void testSideEffects() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/properties/lateinit/isInitializedAndDeinitialize/sideEffects.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/properties/lateinit/isInitializedAndDeinitialize/sideEffects.kt");
|
||||||
|
|||||||
@@ -11735,8 +11735,7 @@ public class IntentionTestGenerated extends AbstractIntentionTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testAllFilesPresentInMoveMemberToTopLevel() throws Exception {
|
public void testAllFilesPresentInMoveMemberToTopLevel() throws Exception {
|
||||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/intentions/moveMemberToTopLevel"),
|
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/intentions/moveMemberToTopLevel"), Pattern.compile("^([\\w\\-_]+)\\.(kt|kts)$"), TargetBackend.ANY, true);
|
||||||
Pattern.compile("^([\\w\\-_]+)\\.kt$"), TargetBackend.ANY, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("function.kt")
|
@TestMetadata("function.kt")
|
||||||
@@ -11771,15 +11770,13 @@ public class IntentionTestGenerated extends AbstractIntentionTest {
|
|||||||
|
|
||||||
@TestMetadata("redeclarationConflictWithPackage.kt")
|
@TestMetadata("redeclarationConflictWithPackage.kt")
|
||||||
public void testRedeclarationConflictWithPackage() throws Exception {
|
public void testRedeclarationConflictWithPackage() throws Exception {
|
||||||
String fileName =
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/moveMemberToTopLevel/redeclarationConflictWithPackage.kt");
|
||||||
KotlinTestUtils.navigationMetadata("idea/testData/intentions/moveMemberToTopLevel/redeclarationConflictWithPackage.kt");
|
|
||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("redeclarationPropertyConflict.kt")
|
@TestMetadata("redeclarationPropertyConflict.kt")
|
||||||
public void testRedeclarationPropertyConflict() throws Exception {
|
public void testRedeclarationPropertyConflict() throws Exception {
|
||||||
String fileName =
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/moveMemberToTopLevel/redeclarationPropertyConflict.kt");
|
||||||
KotlinTestUtils.navigationMetadata("idea/testData/intentions/moveMemberToTopLevel/redeclarationPropertyConflict.kt");
|
|
||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+12
@@ -15252,6 +15252,18 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("propertyImportedFromObject.kt")
|
||||||
|
public void testPropertyImportedFromObject() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/properties/lateinit/isInitializedAndDeinitialize/propertyImportedFromObject.kt");
|
||||||
|
try {
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
catch (Throwable ignore) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that.");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("sideEffects.kt")
|
@TestMetadata("sideEffects.kt")
|
||||||
public void testSideEffects() throws Exception {
|
public void testSideEffects() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/properties/lateinit/isInitializedAndDeinitialize/sideEffects.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/properties/lateinit/isInitializedAndDeinitialize/sideEffects.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user