K2 Scripting: fix locality of script declarations

the script declarations are considered public, at least because they
can be reused from another script then used with the `importedScripts`
configuration property. It also improves the compatibility with K1
scripting.
This commit is contained in:
Ilya Chernikov
2023-06-15 11:48:28 +02:00
committed by Space Team
parent 020a590df7
commit 1d88c307ea
4 changed files with 13 additions and 13 deletions
@@ -9,26 +9,26 @@ FILE fqName:<root> fileName:/destructuringDeclaration.kts
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:def type:kotlin.Int visibility:private [final]' type=kotlin.Unit origin=null
value: CALL 'public final fun component2 (): kotlin.Int declared in <root>.<script-destructuringDeclaration.kts>.A' type=kotlin.Int origin=COMPONENT_N(index=2)
$this: GET_VAR 'val tmp_0: <root>.<script-destructuringDeclaration.kts>.A declared in <root>.<script-destructuringDeclaration.kts>' type=<root>.<script-destructuringDeclaration.kts>.A origin=null
PROPERTY name:abc visibility:local modality:FINAL [val]
PROPERTY name:abc visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:abc type:kotlin.Int visibility:private [final]
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-abc> visibility:local modality:FINAL <> () returnType:kotlin.Int
correspondingProperty: PROPERTY name:abc visibility:local modality:FINAL [val]
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-abc> visibility:public modality:FINAL <> () returnType:kotlin.Int
correspondingProperty: PROPERTY name:abc visibility:public modality:FINAL [val]
BLOCK_BODY
RETURN type=kotlin.Nothing from='local final fun <get-abc> (): kotlin.Int declared in <root>.<script-destructuringDeclaration.kts>'
RETURN type=kotlin.Nothing from='public final fun <get-abc> (): kotlin.Int declared in <root>.<script-destructuringDeclaration.kts>'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:abc type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
PROPERTY name:def visibility:local modality:FINAL [val]
PROPERTY name:def visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:def type:kotlin.Int visibility:private [final]
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-def> visibility:local modality:FINAL <> () returnType:kotlin.Int
correspondingProperty: PROPERTY name:def visibility:local modality:FINAL [val]
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-def> visibility:public modality:FINAL <> () returnType:kotlin.Int
correspondingProperty: PROPERTY name:def visibility:public modality:FINAL [val]
BLOCK_BODY
RETURN type=kotlin.Nothing from='local final fun <get-def> (): kotlin.Int declared in <root>.<script-destructuringDeclaration.kts>'
RETURN type=kotlin.Nothing from='public final fun <get-def> (): kotlin.Int declared in <root>.<script-destructuringDeclaration.kts>'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:def type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
PROPERTY name:rv visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:rv type:kotlin.Int visibility:private [final]
EXPRESSION_BODY
CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS
$this: CALL 'local final fun <get-abc> (): kotlin.Int declared in <root>.<script-destructuringDeclaration.kts>' type=kotlin.Int origin=GET_PROPERTY
other: CALL 'local final fun <get-def> (): kotlin.Int declared in <root>.<script-destructuringDeclaration.kts>' type=kotlin.Int origin=GET_PROPERTY
$this: CALL 'public final fun <get-abc> (): kotlin.Int declared in <root>.<script-destructuringDeclaration.kts>' type=kotlin.Int origin=GET_PROPERTY
other: CALL 'public final fun <get-def> (): kotlin.Int declared in <root>.<script-destructuringDeclaration.kts>' type=kotlin.Int origin=GET_PROPERTY
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-rv> visibility:public modality:FINAL <> () returnType:kotlin.Int
correspondingProperty: PROPERTY name:rv visibility:public modality:FINAL [val]
BLOCK_BODY