K2: fix outerClassSymbol behavior for local classes #KT-55018 Fixed
This commit is contained in:
committed by
Space Team
parent
fb09f139dd
commit
1d76bce3dd
@@ -0,0 +1,48 @@
|
||||
FILE fqName:<root> fileName:/localCompanion.kt
|
||||
FUN name:main visibility:public modality:FINAL <> () returnType:kotlin.Unit
|
||||
BLOCK_BODY
|
||||
CLASS CLASS name:Foo modality:FINAL visibility:local superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.main.Foo
|
||||
CONSTRUCTOR visibility:public <> () returnType:<root>.main.Foo [primary]
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Foo modality:FINAL visibility:local superTypes:[kotlin.Any]'
|
||||
CLASS OBJECT name:Companion modality:FINAL visibility:local [companion] superTypes:[kotlin.Any]
|
||||
annotations:
|
||||
Suppress(names = ['WRONG_MODIFIER_CONTAINING_DECLARATION'])
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.main.Foo.Companion
|
||||
CONSTRUCTOR visibility:private <> () returnType:<root>.main.Foo.Companion [primary]
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Companion modality:FINAL visibility:local [companion] superTypes:[kotlin.Any]'
|
||||
FUN name:bar visibility:public modality:FINAL <> ($this:<root>.main.Foo.Companion) returnType:kotlin.Unit
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.main.Foo.Companion
|
||||
BLOCK_BODY
|
||||
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
|
||||
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
|
||||
CALL 'public final fun bar (): kotlin.Unit declared in <root>.main.Foo.Companion' type=kotlin.Unit origin=null
|
||||
$this: GET_OBJECT 'CLASS OBJECT name:Companion modality:FINAL visibility:local [companion] superTypes:[kotlin.Any]' type=<root>.main.Foo.Companion
|
||||
@@ -0,0 +1,10 @@
|
||||
// FIR_IDENTICAL
|
||||
fun main() {
|
||||
class Foo {
|
||||
@Suppress("WRONG_MODIFIER_CONTAINING_DECLARATION")
|
||||
companion object {
|
||||
fun bar() {}
|
||||
}
|
||||
}
|
||||
Foo.Companion.bar()
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
fun main() {
|
||||
local class Foo {
|
||||
constructor() /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
}
|
||||
|
||||
@Suppress(names = ["WRONG_MODIFIER_CONTAINING_DECLARATION"])
|
||||
local companion object Companion {
|
||||
private constructor() /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
}
|
||||
|
||||
fun bar() {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Companion.bar()
|
||||
}
|
||||
Reference in New Issue
Block a user