Introduce experimental FIR compiler #KT-31265 Fixed

This commit also includes several FIR2IR fixes which helps FIR compiler
to produce normal results
This commit is contained in:
Mikhail Glukhikh
2019-05-16 11:48:02 +03:00
parent 892419c08a
commit f4fdc66a34
42 changed files with 331 additions and 54 deletions
@@ -55,7 +55,7 @@ FILE fqName:<root> fileName:/classLiteralInAnnotation.kt
BLOCK type=<root>.test2.<no name provided> origin=OBJECT_LITERAL
CLASS OBJECT name:<no name provided> modality:FINAL visibility:local superTypes:[kotlin.Any]
annotations:
A(klass = <null>)
A(klass = GET_CLASS type=kotlin.reflect.KClass<IrErrorType>)
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.test2.<no name provided>
CONSTRUCTOR visibility:private <> () returnType:kotlin.Any [primary]
BLOCK_BODY
@@ -70,7 +70,7 @@ FILE fqName:<root> fileName:/classLiteralInAnnotation.kt
BLOCK type=<root>.<get-test3>.<no name provided> origin=OBJECT_LITERAL
CLASS OBJECT name:<no name provided> modality:FINAL visibility:local superTypes:[kotlin.Any]
annotations:
A(klass = <null>)
A(klass = GET_CLASS type=kotlin.reflect.KClass<IrErrorType>)
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.<get-test3>.<no name provided>
CONSTRUCTOR visibility:private <> () returnType:kotlin.Any [primary]
BLOCK_BODY
@@ -84,7 +84,7 @@ FILE fqName:<root> fileName:/classLiteralInAnnotation.kt
BLOCK type=<root>.<set-test3>.<no name provided> origin=OBJECT_LITERAL
CLASS OBJECT name:<no name provided> modality:FINAL visibility:local superTypes:[kotlin.Any]
annotations:
A(klass = <null>)
A(klass = GET_CLASS type=kotlin.reflect.KClass<IrErrorType>)
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.<set-test3>.<no name provided>
CONSTRUCTOR visibility:private <> () returnType:kotlin.Any [primary]
BLOCK_BODY
@@ -29,7 +29,7 @@ FILE fqName:<root> fileName:/classesWithAnnotations.kt
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
CLASS CLASS name:TestClass modality:FINAL visibility:public superTypes:[kotlin.Any]
annotations:
TestAnn(x = <null>)
TestAnn(x = 'class')
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestClass
CONSTRUCTOR visibility:public <> () returnType:<root>.TestClass [primary]
BLOCK_BODY
@@ -50,7 +50,7 @@ FILE fqName:<root> fileName:/classesWithAnnotations.kt
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
CLASS INTERFACE name:TestInterface modality:ABSTRACT visibility:public superTypes:[kotlin.Any]
annotations:
TestAnn(x = <null>)
TestAnn(x = 'interface')
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestInterface
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
overridden:
@@ -67,7 +67,7 @@ FILE fqName:<root> fileName:/classesWithAnnotations.kt
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
CLASS OBJECT name:TestObject modality:FINAL visibility:public superTypes:[kotlin.Any]
annotations:
TestAnn(x = <null>)
TestAnn(x = 'object')
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestObject
CONSTRUCTOR visibility:private <> () returnType:<root>.TestObject [primary]
BLOCK_BODY
@@ -94,7 +94,7 @@ FILE fqName:<root> fileName:/classesWithAnnotations.kt
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]'
CLASS OBJECT name:TestCompanion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]
annotations:
TestAnn(x = <null>)
TestAnn(x = 'companion')
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Host.TestCompanion
CONSTRUCTOR visibility:private <> () returnType:<root>.Host.TestCompanion [primary]
BLOCK_BODY
@@ -128,7 +128,7 @@ FILE fqName:<root> fileName:/classesWithAnnotations.kt
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
CLASS ENUM_CLASS name:TestEnum modality:FINAL visibility:public superTypes:[kotlin.Enum]
annotations:
TestAnn(x = <null>)
TestAnn(x = 'enum')
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestEnum
CONSTRUCTOR visibility:private <> () returnType:<root>.TestEnum [primary]
BLOCK_BODY
@@ -158,7 +158,7 @@ FILE fqName:<root> fileName:/classesWithAnnotations.kt
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum
CLASS ANNOTATION_CLASS name:TestAnnotation modality:FINAL visibility:public superTypes:[kotlin.Annotation]
annotations:
TestAnn(x = <null>)
TestAnn(x = 'annotation')
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestAnnotation
CONSTRUCTOR visibility:public <> () returnType:<root>.TestAnnotation [primary]
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
@@ -83,7 +83,7 @@ FILE fqName:<root> fileName:/delegatedPropertyAccessorsWithAnnotations.kt
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
PROPERTY name:test1 visibility:public modality:FINAL [delegated,val]
annotations:
A(x = <null>)
A(x = 'test1.get')
FIELD PROPERTY_BACKING_FIELD name:test1 type:IrErrorType visibility:public [final,static]
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test1> visibility:public modality:FINAL <> () returnType:IrErrorType
correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [delegated,val]
@@ -92,9 +92,9 @@ FILE fqName:<root> fileName:/delegatedPropertyAccessorsWithAnnotations.kt
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null
PROPERTY name:test2 visibility:public modality:FINAL [delegated,var]
annotations:
A(x = <null>)
A(x = <null>)
A(x = <null>)
A(x = 'test2.get')
A(x = 'test2.set')
A(x = 'test2.set.param')
FIELD PROPERTY_BACKING_FIELD name:test2 type:IrErrorType visibility:public [static]
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test2> visibility:public modality:FINAL <> () returnType:IrErrorType
correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [delegated,var]
@@ -35,7 +35,7 @@ FILE fqName:<root> fileName:/enumEntriesWithAnnotations.kt
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum modality:FINAL visibility:public superTypes:[kotlin.Enum]'
CLASS ENUM_ENTRY name:ENTRY1 modality:FINAL visibility:public superTypes:[kotlin.Any]
annotations:
TestAnn(x = <null>)
TestAnn(x = 'ENTRY1')
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestEnum.ENTRY1
CONSTRUCTOR visibility:public <> () returnType:<root>.TestEnum.ENTRY1 [primary]
BLOCK_BODY
@@ -56,7 +56,7 @@ FILE fqName:<root> fileName:/enumEntriesWithAnnotations.kt
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
CLASS ENUM_ENTRY name:ENTRY2 modality:FINAL visibility:public superTypes:[kotlin.Any]
annotations:
TestAnn(x = <null>)
TestAnn(x = 'ENTRY2')
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestEnum.ENTRY2
CONSTRUCTOR visibility:public <> () returnType:<root>.TestEnum.ENTRY2 [primary]
BLOCK_BODY
@@ -29,7 +29,7 @@ FILE fqName:<root> fileName:/fieldsWithAnnotations.kt
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
PROPERTY name:testVal visibility:public modality:FINAL [val]
annotations:
TestAnn(x = <null>)
TestAnn(x = 'testVal.field')
FIELD PROPERTY_BACKING_FIELD name:testVal type:kotlin.String visibility:public [final,static]
EXPRESSION_BODY
CONST String type=kotlin.String value="a val"
@@ -40,7 +40,7 @@ FILE fqName:<root> fileName:/fieldsWithAnnotations.kt
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testVal type:kotlin.String visibility:public [final,static] ' type=kotlin.String origin=null
PROPERTY name:testVar visibility:public modality:FINAL [var]
annotations:
TestAnn(x = <null>)
TestAnn(x = 'testVar.field')
FIELD PROPERTY_BACKING_FIELD name:testVar type:kotlin.String visibility:public [static]
EXPRESSION_BODY
CONST String type=kotlin.String value="a var"
@@ -1,6 +1,6 @@
FILE fqName:test fileName:/fileAnnotations.kt
annotations:
A(x = <null>)
A(x = 'File annotation')
CLASS ANNOTATION_CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Annotation]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:test.A
CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:test.A [primary]
@@ -29,7 +29,7 @@ FILE fqName:<root> fileName:/propertiesWithAnnotations.kt
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
PROPERTY name:testVal visibility:public modality:FINAL [val]
annotations:
TestAnn(x = <null>)
TestAnn(x = 'testVal.property')
FIELD PROPERTY_BACKING_FIELD name:testVal type:kotlin.String visibility:public [final,static]
EXPRESSION_BODY
CONST String type=kotlin.String value=""
@@ -37,7 +37,7 @@ FILE fqName:<root> fileName:/propertyAccessorsFromClassHeaderWithAnnotations.kt
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]'
PROPERTY name:x visibility:public modality:FINAL [val]
annotations:
A(x = <null>)
A(x = 'C.x.get')
FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final]
EXPRESSION_BODY
GET_VAR 'x: kotlin.Int declared in <root>.C.<init>' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER
@@ -50,8 +50,8 @@ FILE fqName:<root> fileName:/propertyAccessorsFromClassHeaderWithAnnotations.kt
receiver: GET_VAR '<this>: <root>.C declared in <root>.C.<get-x>' type=<root>.C origin=null
PROPERTY name:y visibility:public modality:FINAL [var]
annotations:
A(x = <null>)
A(x = <null>)
A(x = 'C.y.get')
A(x = 'C.y.set')
FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:public
EXPRESSION_BODY
GET_VAR 'y: kotlin.Int declared in <root>.C.<init>' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER
@@ -45,7 +45,7 @@ FILE fqName:<root> fileName:/propertyAccessorsWithAnnotations.kt
BLOCK_BODY
PROPERTY name:test3 visibility:public modality:FINAL [val]
annotations:
TestAnn(x = <null>)
TestAnn(x = 'test3.get')
FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.String visibility:public [final,static]
EXPRESSION_BODY
CONST String type=kotlin.String value=""
@@ -56,8 +56,8 @@ FILE fqName:<root> fileName:/propertyAccessorsWithAnnotations.kt
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.String visibility:public [final,static] ' type=kotlin.String origin=null
PROPERTY name:test4 visibility:public modality:FINAL [var]
annotations:
TestAnn(x = <null>)
TestAnn(x = <null>)
TestAnn(x = 'test4.get')
TestAnn(x = 'test4.set')
FIELD PROPERTY_BACKING_FIELD name:test4 type:kotlin.String visibility:public [static]
EXPRESSION_BODY
CONST String type=kotlin.String value=""
@@ -62,7 +62,8 @@ FILE fqName:<root> fileName:/local.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun provideDelegate (thisRef: kotlin.Any?, property: kotlin.Any?): <root>.Delegate declared in <root>.DelegateProvider'
CONSTRUCTOR_CALL 'public constructor <init> (value: kotlin.String) [primary] declared in <root>.Delegate' type=<root>.Delegate origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
value: CALL 'public final fun <get-value> (): kotlin.String declared in <root>.DelegateProvider' type=kotlin.String origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
@@ -62,7 +62,8 @@ FILE fqName:<root> fileName:/member.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun provideDelegate (thisRef: kotlin.Any?, property: kotlin.Any?): <root>.Delegate declared in <root>.DelegateProvider'
CONSTRUCTOR_CALL 'public constructor <init> (value: kotlin.String) [primary] declared in <root>.Delegate' type=<root>.Delegate origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
value: CALL 'public final fun <get-value> (): kotlin.String declared in <root>.DelegateProvider' type=kotlin.String origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
@@ -51,7 +51,8 @@ FILE fqName:<root> fileName:/memberExtension.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun provideDelegate (host: kotlin.Any?, p: kotlin.Any): <root>.Host.StringDelegate declared in <root>.Host'
CONSTRUCTOR_CALL 'public constructor <init> (s: kotlin.String) [primary] declared in <root>.Host.StringDelegate' type=<root>.Host.StringDelegate origin=null
PROPERTY name:plusK visibility:public modality:FINAL [delegated,val]
s: ERROR_CALL 'Unresolved reference: this#' type=kotlin.String
PROPERTY name:plusK visibility:public modality:FINAL [delegated,val]
FIELD PROPERTY_BACKING_FIELD name:plusK type:IrErrorType visibility:public [final]
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-plusK> visibility:public modality:FINAL <> ($this:<root>.Host) returnType:IrErrorType
correspondingProperty: PROPERTY name:plusK visibility:public modality:FINAL [delegated,val]
@@ -62,7 +62,8 @@ FILE fqName:<root> fileName:/topLevel.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun provideDelegate (thisRef: kotlin.Any?, property: kotlin.Any?): <root>.Delegate declared in <root>.DelegateProvider'
CONSTRUCTOR_CALL 'public constructor <init> (value: kotlin.String) [primary] declared in <root>.Delegate' type=<root>.Delegate origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
value: CALL 'public final fun <get-value> (): kotlin.String declared in <root>.DelegateProvider' type=kotlin.String origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any