FIR: consider Java default constructors as primary ones

This commit is contained in:
Mikhail Glukhikh
2019-07-10 18:50:54 +03:00
parent 2ceffa241b
commit c6a09dba4e
9 changed files with 33 additions and 15 deletions
@@ -3,7 +3,7 @@ FILE fqName:<root> fileName:/Derived.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Derived
CONSTRUCTOR visibility:public <> () returnType:<root>.Derived [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.Base'
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.Base'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[<root>.Base]'
ANONYMOUS_INITIALIZER isStatic=false
BLOCK_BODY
+1 -1
View File
@@ -98,7 +98,7 @@ FILE fqName:<root> fileName:/kt16904.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Test2
CONSTRUCTOR visibility:public <> () returnType:<root>.Test2 [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.J'
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.J'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[<root>.J]'
ANONYMOUS_INITIALIZER isStatic=false
BLOCK_BODY
@@ -82,5 +82,5 @@ FILE fqName:<root> fileName:/samConversionsWithSmartCasts.kt
FUN name:test9 visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
CALL 'public open fun run1 (r: java.lang.Runnable?): kotlin.Unit declared in <root>.J' type=kotlin.Unit origin=null
$this: CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.J' type=<root>.J origin=null
$this: CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.J' type=<root>.J origin=null
r: ERROR_CALL 'Unresolved reference: <Unresolved name: test9>#' type=IrErrorType
@@ -3,7 +3,7 @@ FILE fqName:<root> fileName:/Derived.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Derived
CONSTRUCTOR visibility:public <> () returnType:<root>.Derived [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.Base'
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.Base'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[<root>.Base]'
FUN name:setValue visibility:public modality:FINAL <> ($this:<root>.Derived, v:kotlin.Any) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.Derived
+1 -1
View File
@@ -3,7 +3,7 @@ FILE fqName:<root> fileName:/javaInnerClass.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Test1
CONSTRUCTOR visibility:public <> () returnType:<root>.Test1 [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.J'
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.J'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[<root>.J]'
PROPERTY name:test visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:test type:IrErrorType visibility:public [final]
@@ -3,7 +3,7 @@ FILE fqName:<root> fileName:/javaSyntheticProperty.kt
FIELD PROPERTY_BACKING_FIELD name:test type:kotlin.String? visibility:public [final,static]
EXPRESSION_BODY
CALL 'public open fun getFoo (): kotlin.String? declared in <root>.J' type=kotlin.String? origin=null
$this: CONSTRUCTOR_CALL 'public/*package*/ constructor <init> () declared in <root>.J' type=<root>.J origin=null
$this: CONSTRUCTOR_CALL 'public/*package*/ constructor <init> () [primary] declared in <root>.J' type=<root>.J origin=null
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test> visibility:public modality:FINAL <> () returnType:kotlin.String?
correspondingProperty: PROPERTY name:test visibility:public modality:FINAL [val]
BLOCK_BODY