K2: add more tests about false overrides

Related to KT-53197
This commit is contained in:
Mikhail Glukhikh
2022-09-20 11:23:21 +02:00
committed by Space
parent bcd7a531b9
commit de43877161
9 changed files with 157 additions and 0 deletions
@@ -11,6 +11,17 @@ FILE fqName:<root> fileName:/A.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='internal open fun foo (): kotlin.Int declared in <root>.A'
CONST Int type=kotlin.Int value=1
PROPERTY name:bar visibility:internal modality:OPEN [val]
FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.Int visibility:private [final]
EXPRESSION_BODY
CONST Int type=kotlin.Int value=1
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-bar> visibility:internal modality:OPEN <> ($this:<root>.A) returnType:kotlin.Int
correspondingProperty: PROPERTY name:bar visibility:internal modality:OPEN [val]
$this: VALUE_PARAMETER name:<this> type:<root>.A
BLOCK_BODY
RETURN type=kotlin.Nothing from='internal open fun <get-bar> (): kotlin.Int declared in <root>.A'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
receiver: GET_VAR '<this>: <root>.A declared in <root>.A.<get-bar>' type=<root>.A origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
@@ -37,6 +48,17 @@ FILE fqName:<root> fileName:/B.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.String declared in <root>.B'
CONST String type=kotlin.String value="OK"
PROPERTY name:bar visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.Int visibility:private [final]
EXPRESSION_BODY
CONST Int type=kotlin.Int value=2
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-bar> visibility:public modality:FINAL <> ($this:<root>.B) returnType:kotlin.Int
correspondingProperty: PROPERTY name:bar visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.B
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-bar> (): kotlin.Int declared in <root>.B'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
receiver: GET_VAR '<this>: <root>.B declared in <root>.B.<get-bar>' type=<root>.B origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in <root>.A