FIR: make declarations marked with 'override' implicitly open

#KT-52236 Fixed
This commit is contained in:
Steven Schäfer
2022-11-18 16:13:01 +01:00
committed by Space Team
parent 9c1a68fcec
commit 6af616d3c3
205 changed files with 638 additions and 10616 deletions
@@ -36,13 +36,13 @@ FILE fqName:<root> fileName:/unboundMemberReferenceWithAdaptedArguments.kt
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.A'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Obj modality:FINAL visibility:public superTypes:[<root>.A]'
FUN name:foo visibility:public modality:FINAL <> ($this:<root>.Obj, xs:kotlin.IntArray) returnType:kotlin.Int
FUN name:foo visibility:public modality:OPEN <> ($this:<root>.Obj, xs:kotlin.IntArray) returnType:kotlin.Int
overridden:
public open fun foo (vararg xs: kotlin.Int): kotlin.Int declared in <root>.A
$this: VALUE_PARAMETER name:<this> type:<root>.Obj
VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg]
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun foo (vararg xs: kotlin.Int): kotlin.Int declared in <root>.Obj'
RETURN type=kotlin.Nothing from='public open fun foo (vararg xs: kotlin.Int): kotlin.Int declared in <root>.Obj'
CONST Int type=kotlin.Int value=1
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
@@ -92,7 +92,7 @@ FILE fqName:<root> fileName:/unboundMemberReferenceWithAdaptedArguments.kt
$receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:receiver type:<root>.Obj
VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:p0 index:0 type:kotlin.Int
BLOCK_BODY
CALL 'public final fun foo (vararg xs: kotlin.Int): kotlin.Int declared in <root>.Obj' type=kotlin.Int origin=null
CALL 'public open fun foo (vararg xs: kotlin.Int): kotlin.Int declared in <root>.Obj' type=kotlin.Int origin=null
$this: GET_VAR 'receiver: <root>.Obj declared in <root>.testObject.foo' type=<root>.Obj origin=ADAPTED_FUNCTION_REFERENCE
xs: VARARG type=kotlin.IntArray varargElementType=kotlin.Int
GET_VAR 'p0: kotlin.Int declared in <root>.testObject.foo' type=kotlin.Int origin=null
@@ -26,7 +26,7 @@ FILE fqName:<root> fileName:/enumEntryAsReceiver.kt
RETURN type=kotlin.Nothing from='public final fun <get-value2> (): kotlin.String declared in <root>.X.B'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value2 type:kotlin.String visibility:private [final]' type=kotlin.String origin=null
receiver: GET_VAR '<this>: <root>.X.B declared in <root>.X.B.<get-value2>' type=<root>.X.B origin=null
PROPERTY name:value visibility:public modality:FINAL [val]
PROPERTY name:value visibility:public modality:OPEN [val]
overridden:
public abstract value: kotlin.Function0<kotlin.String> [val]
FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Function0<kotlin.String> visibility:private [final]
@@ -37,13 +37,13 @@ FILE fqName:<root> fileName:/enumEntryAsReceiver.kt
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): kotlin.String declared in <root>.X.B.value'
CALL 'public final fun <get-value2> (): kotlin.String declared in <root>.X.B' type=kotlin.String origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.X.B declared in <root>.X.B' type=<root>.X.B origin=null
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-value> visibility:public modality:FINAL <> ($this:<root>.X.B) returnType:kotlin.Function0<kotlin.String>
correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val]
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-value> visibility:public modality:OPEN <> ($this:<root>.X.B) returnType:kotlin.Function0<kotlin.String>
correspondingProperty: PROPERTY name:value visibility:public modality:OPEN [val]
overridden:
public abstract fun <get-value> (): kotlin.Function0<kotlin.String> declared in <root>.X
$this: VALUE_PARAMETER name:<this> type:<root>.X.B
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-value> (): kotlin.Function0<kotlin.String> declared in <root>.X.B'
RETURN type=kotlin.Nothing from='public open fun <get-value> (): kotlin.Function0<kotlin.String> declared in <root>.X.B'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Function0<kotlin.String> visibility:private [final]' type=kotlin.Function0<kotlin.String> origin=null
receiver: GET_VAR '<this>: <root>.X.B declared in <root>.X.B.<get-value>' type=<root>.X.B origin=null
FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum<E of kotlin.Enum>) returnType:kotlin.Any [fake_override]
@@ -65,7 +65,7 @@ FILE fqName:<root> fileName:/partialSam.kt
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:<no name provided> modality:FINAL visibility:local superTypes:[<root>.Fn<kotlin.String, kotlin.Int>]'
FUN name:run visibility:public modality:FINAL <> ($this:<root>.fsi.<no name provided>, s:kotlin.String, i:kotlin.Int, t:kotlin.String) returnType:kotlin.Int
FUN name:run visibility:public modality:OPEN <> ($this:<root>.fsi.<no name provided>, s:kotlin.String, i:kotlin.Int, t:kotlin.String) returnType:kotlin.Int
overridden:
public abstract fun run (s: kotlin.String, i: kotlin.Int, t: T of <root>.Fn): R of <root>.Fn declared in <root>.Fn
$this: VALUE_PARAMETER name:<this> type:<root>.fsi.<no name provided>
@@ -73,7 +73,7 @@ FILE fqName:<root> fileName:/partialSam.kt
VALUE_PARAMETER name:i index:1 type:kotlin.Int
VALUE_PARAMETER name:t index:2 type:kotlin.String
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun run (s: kotlin.String, i: kotlin.Int, t: kotlin.String): kotlin.Int declared in <root>.fsi.<no name provided>'
RETURN type=kotlin.Nothing from='public open fun run (s: kotlin.String, i: kotlin.Int, t: kotlin.String): kotlin.Int declared in <root>.fsi.<no name provided>'
CONST Int type=kotlin.Int value=1
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
@@ -104,7 +104,7 @@ FILE fqName:<root> fileName:/partialSam.kt
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:<no name provided> modality:FINAL visibility:local superTypes:[<root>.Fn<kotlin.Int, kotlin.String>]'
FUN name:run visibility:public modality:FINAL <> ($this:<root>.fis.<no name provided>, s:kotlin.String, i:kotlin.Int, t:kotlin.Int) returnType:kotlin.String
FUN name:run visibility:public modality:OPEN <> ($this:<root>.fis.<no name provided>, s:kotlin.String, i:kotlin.Int, t:kotlin.Int) returnType:kotlin.String
overridden:
public abstract fun run (s: kotlin.String, i: kotlin.Int, t: T of <root>.Fn): R of <root>.Fn declared in <root>.Fn
$this: VALUE_PARAMETER name:<this> type:<root>.fis.<no name provided>
@@ -112,7 +112,7 @@ FILE fqName:<root> fileName:/partialSam.kt
VALUE_PARAMETER name:i index:1 type:kotlin.Int
VALUE_PARAMETER name:t index:2 type:kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun run (s: kotlin.String, i: kotlin.Int, t: kotlin.Int): kotlin.String declared in <root>.fis.<no name provided>'
RETURN type=kotlin.Nothing from='public open fun run (s: kotlin.String, i: kotlin.Int, t: kotlin.Int): kotlin.String declared in <root>.fis.<no name provided>'
CONST String type=kotlin.String value=""
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
@@ -1,124 +0,0 @@
FILE fqName:<root> fileName:/kt47328.kt
CLASS INTERFACE name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.A
PROPERTY name:x visibility:public modality:ABSTRACT [val]
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-x> visibility:public modality:ABSTRACT <> ($this:<root>.A) returnType:kotlin.Int
correspondingProperty: PROPERTY name:x visibility:public modality:ABSTRACT [val]
$this: VALUE_PARAMETER name:<this> type:<root>.A
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
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
CLASS CLASS name:B modality:FINAL visibility:public superTypes:[<root>.A]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.B
CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:<root>.B [primary]
VALUE_PARAMETER name:x index:0 type:kotlin.Int
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public superTypes:[<root>.A]'
PROPERTY name:x visibility:public modality:FINAL [val]
overridden:
public abstract x: kotlin.Int [val]
FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final]
annotations:
JvmField
EXPRESSION_BODY
GET_VAR 'x: kotlin.Int declared in <root>.B.<init>' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-x> visibility:public modality:FINAL <> ($this:<root>.B) returnType:kotlin.Int
correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val]
overridden:
public abstract fun <get-x> (): kotlin.Int declared in <root>.A
$this: VALUE_PARAMETER name:<this> type:<root>.B
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-x> (): kotlin.Int declared in <root>.B'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final]' type=kotlin.Int origin=null
receiver: GET_VAR '<this>: <root>.B declared in <root>.B.<get-x>' 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
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int [fake_override] declared in <root>.A
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String [fake_override] declared in <root>.A
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.C<D of <root>.C>
TYPE_PARAMETER name:D index:0 variance: superTypes:[<root>.A] reified:false
CONSTRUCTOR visibility:public <> (d:D of <root>.C) returnType:<root>.C<D of <root>.C> [primary]
VALUE_PARAMETER name:d index:0 type:D of <root>.C
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]'
PROPERTY name:d visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:d type:D of <root>.C visibility:public [final]
annotations:
JvmField
EXPRESSION_BODY
GET_VAR 'd: D of <root>.C declared in <root>.C.<init>' type=D of <root>.C origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-d> visibility:public modality:FINAL <> ($this:<root>.C<D of <root>.C>) returnType:D of <root>.C
correspondingProperty: PROPERTY name:d visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.C<D of <root>.C>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-d> (): D of <root>.C declared in <root>.C'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:d type:D of <root>.C visibility:public [final]' type=D of <root>.C origin=null
receiver: GET_VAR '<this>: <root>.C<D of <root>.C> declared in <root>.C.<get-d>' type=<root>.C<D of <root>.C> 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
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
CLASS CLASS name:E modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.E
CONSTRUCTOR visibility:public <> (c:<root>.C<<root>.B>) returnType:<root>.E [primary]
VALUE_PARAMETER name:c index:0 type:<root>.C<<root>.B>
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:E modality:FINAL visibility:public superTypes:[kotlin.Any]'
PROPERTY name:ax visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:ax type:kotlin.Int visibility:private [final]
EXPRESSION_BODY
CALL 'public final fun <get-x> (): kotlin.Int declared in <root>.B' type=kotlin.Int origin=GET_PROPERTY
$this: CALL 'public final fun <get-d> (): D of <root>.C declared in <root>.C' type=<root>.B origin=GET_PROPERTY
$this: GET_VAR 'c: <root>.C<<root>.B> declared in <root>.E.<init>' type=<root>.C<<root>.B> origin=null
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-ax> visibility:public modality:FINAL <> ($this:<root>.E) returnType:kotlin.Int
correspondingProperty: PROPERTY name:ax visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.E
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-ax> (): kotlin.Int declared in <root>.E'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:ax type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
receiver: GET_VAR '<this>: <root>.E declared in <root>.E.<get-ax>' type=<root>.E 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
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
+1
View File
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// This test can be removed as soon as the compiler stops supporting language version 1.5.
// !LANGUAGE: -ProhibitJvmFieldOnOverrideFromInterfaceInPrimaryConstructor
// SKIP_KT_DUMP