[FIR] Make FirFile.annotationsContainer nullable

Previously, when no file annotations were present, the FIR element
didn't have a source.
By making it nullable, it will only be created when appropriate and the
source will never be null.

#KT-55835
This commit is contained in:
Kirill Rakhman
2023-06-26 15:06:13 +03:00
committed by Space Team
parent 311975f1ed
commit bed6cb7154
334 changed files with 47 additions and 1937 deletions
@@ -10,7 +10,6 @@ public final [ResolvedTo(BODY_RESOLVE)] val p: R|kotlin/String|by ERROR_EXPR(Sho
FIR FILE:
FILE: [ResolvedTo(IMPORTS)] delegatedProperty.kt
[ResolvedTo(BODY_RESOLVE)] annotations container
public final [ResolvedTo(BODY_RESOLVE)] val p: R|kotlin/String|by ERROR_EXPR(Should have delegate)
public [ResolvedTo(BODY_RESOLVE)] get(): R|kotlin/String| {
^ D|/p|.<Unresolved name: getValue>#(Null(null), ::R|/p|)
@@ -8,7 +8,6 @@ public final [ResolvedTo(BODY_RESOLVE)] fun foo(): R|kotlin/Unit| {
FIR FILE:
FILE: [ResolvedTo(IMPORTS)] duplicatedClasses.kt
[ResolvedTo(BODY_RESOLVE)] annotations container
public final [ResolvedTo(STATUS)] class SomeClass : R|kotlin/Any| {
public [ResolvedTo(STATUS)] [ContainingClassKey=SomeClass] constructor(): R|SomeClass| {
LAZY_super<R|kotlin/Any|>
@@ -7,7 +7,6 @@ FIR element rendered:
FIR FILE:
FILE: [ResolvedTo(IMPORTS)] duplicatedClassesFunctionParameter.kt
[ResolvedTo(BODY_RESOLVE)] annotations container
public final [ResolvedTo(STATUS)] class SomeClass : R|kotlin/Any| {
public [ResolvedTo(STATUS)] [ContainingClassKey=SomeClass] constructor(): R|SomeClass| {
LAZY_super<R|kotlin/Any|>
@@ -7,7 +7,6 @@ FIR element rendered:
FIR FILE:
FILE: [ResolvedTo(IMPORTS)] expectAndActualInTheSameFile.kt
[ResolvedTo(BODY_RESOLVE)] annotations container
public? final? [ResolvedTo(RAW_FIR)] fun main(): R|kotlin/Unit| { LAZY_BLOCK }
public? final? expect [ResolvedTo(RAW_FIR)] fun f(): R|kotlin/Unit|
public? final? [ResolvedTo(RAW_FIR)] fun test(): R|kotlin/Unit| { LAZY_BLOCK }
@@ -7,7 +7,6 @@ FIR element rendered:
FIR FILE:
FILE: [ResolvedTo(IMPORTS)] incompletePropertyWithAnnotation.kt
[ResolvedTo(BODY_RESOLVE)] annotations container
@<ERROR TYPE REF: Symbol not found for Volatile>[Types]() private final [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] var <no name provided>: <ERROR TYPE REF: Cannot infer variable type without initializer / getter / delegate>
private [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] get(): <ERROR TYPE REF: Cannot infer variable type without initializer / getter / delegate>
private [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] set([ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] value: <ERROR TYPE REF: Cannot infer variable type without initializer / getter / delegate>): R|kotlin/Unit|
@@ -7,7 +7,6 @@ R|<local>/anyClass|
FIR FILE:
FILE: [ResolvedTo(IMPORTS)] javaClassLiteral.kt
[ResolvedTo(BODY_RESOLVE)] annotations container
public final [ResolvedTo(BODY_RESOLVE)] fun main([ResolvedTo(BODY_RESOLVE)] args: R|kotlin/Array<kotlin/String>|): R|kotlin/Unit| {
[ResolvedTo(BODY_RESOLVE)] lval anyClass: R|kotlin/Any| = R|kotlin/Any.Any|()
R|/funOne|(<ERROR TYPE REF: Qualified expression with unexpected selector>ERROR_EXPR(Incorrect selector expression)R|<local>/anyClass|)
@@ -7,7 +7,6 @@ FIR element rendered:
FIR FILE:
FILE: [ResolvedTo(IMPORTS)] secondaryConstructor.kt
[ResolvedTo(BODY_RESOLVE)] annotations container
public final [ResolvedTo(BODY_RESOLVE)] annotation class JsQualifier : R|kotlin/Annotation|, R|kotlin/Annotation| {
public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=JsQualifier] constructor(): R|JsQualifier| {
super<R|kotlin/Any|>()