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
+2
-2
@@ -3,7 +3,7 @@ FIR element: FirPropertyAccessExpressionImpl
|
||||
FIR source kind: KtRealSourceElementKind
|
||||
|
||||
FIR element rendered:
|
||||
R|<local>/args|.R|SubstitutionOverride<kotlin/Array.size: R|kotlin/Int|>|
|
||||
this@R|?|.R|kotlin/script/templates/standard/ScriptTemplateWithArgs.args|.R|SubstitutionOverride<kotlin/Array.size: R|kotlin/Int|>|
|
||||
|
||||
FIR FILE:
|
||||
FILE: [ResolvedTo(IMPORTS)] argsFromFunction.kts
|
||||
@@ -12,5 +12,5 @@ FILE: [ResolvedTo(IMPORTS)] argsFromFunction.kts
|
||||
[ResolvedTo(RAW_FIR)] lval args: R|kotlin/Array<kotlin/String>|
|
||||
|
||||
public final [ResolvedTo(BODY_RESOLVE)] fun foo(): R|kotlin/Int| {
|
||||
^foo R|<local>/args|.R|SubstitutionOverride<kotlin/Array.size: R|kotlin/Int|>|
|
||||
^foo this@R|?|.R|kotlin/script/templates/standard/ScriptTemplateWithArgs.args|.R|SubstitutionOverride<kotlin/Array.size: R|kotlin/Int|>|
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ FIR source kind: KtRealSourceElementKind
|
||||
|
||||
FIR element rendered:
|
||||
{
|
||||
^ R|<local>/args|.R|SubstitutionOverride<kotlin/Array.size: R|kotlin/Int|>|
|
||||
^ this@R|?|.R|kotlin/script/templates/standard/ScriptTemplateWithArgs.args|.R|SubstitutionOverride<kotlin/Array.size: R|kotlin/Int|>|
|
||||
}
|
||||
|
||||
FIR FILE:
|
||||
@@ -20,7 +20,7 @@ FILE: [ResolvedTo(IMPORTS)] argsFromInit.kts
|
||||
|
||||
[ResolvedTo(BODY_RESOLVE)] init {
|
||||
<Unresolved name: foo>#(<L> = [ResolvedTo(BODY_RESOLVE)] foo@fun <anonymous>(): R|kotlin/Int| <inline=Unknown> {
|
||||
^ R|<local>/args|.R|SubstitutionOverride<kotlin/Array.size: R|kotlin/Int|>|
|
||||
^ this@R|?|.R|kotlin/script/templates/standard/ScriptTemplateWithArgs.args|.R|SubstitutionOverride<kotlin/Array.size: R|kotlin/Int|>|
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
+2
-2
@@ -3,7 +3,7 @@ FIR element: FirPropertyAccessExpressionImpl
|
||||
FIR source kind: KtRealSourceElementKind
|
||||
|
||||
FIR element rendered:
|
||||
R|<local>/args|.R|SubstitutionOverride<kotlin/Array.size: R|kotlin/Int|>|
|
||||
this@R|?|.R|kotlin/script/templates/standard/ScriptTemplateWithArgs.args|.R|SubstitutionOverride<kotlin/Array.size: R|kotlin/Int|>|
|
||||
|
||||
FIR FILE:
|
||||
FILE: [ResolvedTo(IMPORTS)] argsFromMemberFunction.kts
|
||||
@@ -17,7 +17,7 @@ FILE: [ResolvedTo(IMPORTS)] argsFromMemberFunction.kts
|
||||
}
|
||||
|
||||
public final [ResolvedTo(BODY_RESOLVE)] fun foo(): R|kotlin/Unit| {
|
||||
R|<local>/args|.R|SubstitutionOverride<kotlin/Array.size: R|kotlin/Int|>|
|
||||
this@R|?|.R|kotlin/script/templates/standard/ScriptTemplateWithArgs.args|.R|SubstitutionOverride<kotlin/Array.size: R|kotlin/Int|>|
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -3,7 +3,7 @@ FIR element: FirPropertyAccessExpressionImpl
|
||||
FIR source kind: KtRealSourceElementKind
|
||||
|
||||
FIR element rendered:
|
||||
R|<local>/args|.R|SubstitutionOverride<kotlin/Array.size: R|kotlin/Int|>|
|
||||
this@R|?|.R|kotlin/script/templates/standard/ScriptTemplateWithArgs.args|.R|SubstitutionOverride<kotlin/Array.size: R|kotlin/Int|>|
|
||||
|
||||
FIR FILE:
|
||||
FILE: [ResolvedTo(IMPORTS)] argsFromMemberProperty.kts
|
||||
@@ -18,7 +18,7 @@ FILE: [ResolvedTo(IMPORTS)] argsFromMemberProperty.kts
|
||||
|
||||
public final [ResolvedTo(BODY_RESOLVE)] val i: R|kotlin/Int|
|
||||
public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=A] get(): R|kotlin/Int| {
|
||||
^ R|<local>/args|.R|SubstitutionOverride<kotlin/Array.size: R|kotlin/Int|>|
|
||||
^ this@R|?|.R|kotlin/script/templates/standard/ScriptTemplateWithArgs.args|.R|SubstitutionOverride<kotlin/Array.size: R|kotlin/Int|>|
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -3,7 +3,7 @@ FIR element: FirPropertyAccessExpressionImpl
|
||||
FIR source kind: KtRealSourceElementKind
|
||||
|
||||
FIR element rendered:
|
||||
R|<local>/args|.R|SubstitutionOverride<kotlin/Array.size: R|kotlin/Int|>|
|
||||
this@R|?|.R|kotlin/script/templates/standard/ScriptTemplateWithArgs.args|.R|SubstitutionOverride<kotlin/Array.size: R|kotlin/Int|>|
|
||||
|
||||
FIR FILE:
|
||||
FILE: [ResolvedTo(IMPORTS)] argsFromProperty.kts
|
||||
@@ -11,5 +11,5 @@ FILE: [ResolvedTo(IMPORTS)] argsFromProperty.kts
|
||||
SCRIPT: [ResolvedTo(TYPES)] <script-argsFromProperty.kts>
|
||||
[ResolvedTo(RAW_FIR)] lval args: R|kotlin/Array<kotlin/String>|
|
||||
|
||||
public final [ResolvedTo(BODY_RESOLVE)] val bar: R|kotlin/Int| = R|<local>/args|.R|SubstitutionOverride<kotlin/Array.size: R|kotlin/Int|>|
|
||||
public final [ResolvedTo(BODY_RESOLVE)] val bar: R|kotlin/Int| = this@R|?|.R|kotlin/script/templates/standard/ScriptTemplateWithArgs.args|.R|SubstitutionOverride<kotlin/Array.size: R|kotlin/Int|>|
|
||||
public [ResolvedTo(BODY_RESOLVE)] get(): R|kotlin/Int|
|
||||
|
||||
+2
-2
@@ -3,7 +3,7 @@ FIR element: FirPropertyAccessExpressionImpl
|
||||
FIR source kind: KtRealSourceElementKind
|
||||
|
||||
FIR element rendered:
|
||||
R|<local>/args|.R|SubstitutionOverride<kotlin/Array.size: R|kotlin/Int|>|
|
||||
this@R|?|.R|kotlin/script/templates/standard/ScriptTemplateWithArgs.args|.R|SubstitutionOverride<kotlin/Array.size: R|kotlin/Int|>|
|
||||
|
||||
FIR FILE:
|
||||
FILE: [ResolvedTo(IMPORTS)] argsFromStatement.kts
|
||||
@@ -12,7 +12,7 @@ FILE: [ResolvedTo(IMPORTS)] argsFromStatement.kts
|
||||
[ResolvedTo(RAW_FIR)] lval args: R|kotlin/Array<kotlin/String>|
|
||||
|
||||
public final [ResolvedTo(BODY_RESOLVE)] val $$result: <ERROR TYPE REF: Unresolved name: foo> = <Unresolved name: foo>#(<L> = [ResolvedTo(BODY_RESOLVE)] foo@fun <anonymous>(): R|kotlin/Int| <inline=Unknown> {
|
||||
^ R|<local>/args|.R|SubstitutionOverride<kotlin/Array.size: R|kotlin/Int|>|
|
||||
^ this@R|?|.R|kotlin/script/templates/standard/ScriptTemplateWithArgs.args|.R|SubstitutionOverride<kotlin/Array.size: R|kotlin/Int|>|
|
||||
}
|
||||
)
|
||||
public [ResolvedTo(BODY_RESOLVE)] get(): <ERROR TYPE REF: Unresolved name: foo>
|
||||
Reference in New Issue
Block a user