K2 Scripting: Skip base class params from resolution scope
The base class in scripting considered obsolete and therefore supported via some ad-hoc mechanisms. In particular parameters to the base class c-tor are passed via script provided properties. But in combination with the resolution logic, this leads to issues described in KT-60452 This commits filters out such parameters from script resolution scope and avoids this problem for now. Bot it should be noted that proper diagnostics for properties shadowing should still be implemented - see #KT-65809 #KT-60452 fixed
This commit is contained in:
committed by
Space Team
parent
49559d2a5a
commit
9037975758
+5
@@ -0,0 +1,5 @@
|
||||
// param: O K
|
||||
|
||||
val rv = args[0] + args[1]
|
||||
|
||||
// expected: rv: OK
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// SCRIPT_PROVIDED_PROPERTIES: prop1: kotlin.String
|
||||
|
||||
val prop1 = 42 // TODO: Error should be reported on this shadowing, see KT-65809
|
||||
|
||||
val rv = 0 <!NONE_APPLICABLE!>+<!> prop1
|
||||
+6
@@ -25,6 +25,12 @@ public class ScriptWithCustomDefBlackBoxCodegenTestGenerated extends AbstractScr
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/scripting/scripting-tests/testData/codegen/testScripts"), Pattern.compile("^(.+)\\.kts$"), null, TargetBackend.JVM_IR, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("params.test.kts")
|
||||
public void testParams_test() {
|
||||
runTest("plugins/scripting/scripting-tests/testData/codegen/testScripts/params.test.kts");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("simple.test.kts")
|
||||
public void testSimple_test() {
|
||||
|
||||
+6
@@ -24,6 +24,12 @@ public class ScriptWithCustomDefDiagnosticsTestBaseGenerated extends AbstractScr
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/scripting/scripting-tests/testData/diagnostics/testScripts"), Pattern.compile("^(.+)\\.kts$"), null, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("providedPropertiesShadowing.test.kts")
|
||||
public void testProvidedPropertiesShadowing_test() {
|
||||
runTest("plugins/scripting/scripting-tests/testData/diagnostics/testScripts/providedPropertiesShadowing.test.kts");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("providedProperties.test.kts")
|
||||
public void testProvidedProperties_test() {
|
||||
|
||||
Reference in New Issue
Block a user