Psi2ir: do not generate default accessor body for expect properties
Because generateDefaultGetterBody/generateDefaultSetterBody reference the property's backing field, which in case of extension properties leads to an error "Unbound symbols not allowed" because extension property cannot have a backing field. In some way, this check is similar to the `isExpect` check in `generatePrimaryConstructor`.
This commit is contained in:
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java
Generated
+5
@@ -16377,6 +16377,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true);
|
||||
}
|
||||
|
||||
@TestMetadata("expectProperty.kt")
|
||||
public void testExpectProperty() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/multiplatform/expectProperty.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("optionalExpectation.kt")
|
||||
public void testOptionalExpectation() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/multiplatform/optionalExpectation.kt");
|
||||
|
||||
Generated
+5
@@ -15834,6 +15834,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true);
|
||||
}
|
||||
|
||||
@TestMetadata("expectProperty.kt")
|
||||
public void testExpectProperty() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/multiplatform/expectProperty.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("optionalExpectation.kt")
|
||||
public void testOptionalExpectation() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/multiplatform/optionalExpectation.kt");
|
||||
|
||||
Generated
+5
@@ -15899,6 +15899,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true);
|
||||
}
|
||||
|
||||
@TestMetadata("expectProperty.kt")
|
||||
public void testExpectProperty() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/multiplatform/expectProperty.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("optionalExpectation.kt")
|
||||
public void testOptionalExpectation() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/multiplatform/optionalExpectation.kt");
|
||||
|
||||
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java
Generated
+5
@@ -9740,6 +9740,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true);
|
||||
}
|
||||
|
||||
@TestMetadata("expectProperty.kt")
|
||||
public void testExpectProperty() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/multiplatform/expectProperty.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("optionalExpectation.kt")
|
||||
public void testOptionalExpectation() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/multiplatform/optionalExpectation.kt");
|
||||
|
||||
Reference in New Issue
Block a user