[FIR] pass correct scope during annotation resolve for local declarations

We should pass container for correct logic around CLASS_HEADER_ANNOTATIONS.
Also, such correct containers will be used in the context of KT-63042 to
correctly detect an annotation ownership

^KT-63042
^KT-63842 Fixed
This commit is contained in:
Dmitrii Gridin
2023-11-27 19:11:32 +01:00
committed by Space Team
parent fcb3f003dc
commit 06aad65ed3
27 changed files with 131 additions and 146 deletions
@@ -9,7 +9,7 @@ fun foo() {
class OriginalClass<@Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>"type param $localProp"<!>) T : @Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>"bound $localProp"<!>) List<@Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>"nested bound $localProp"<!>) Int>> : @Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>"super type $localProp"<!>) A<@Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>"nested super type $localProp"<!>) List<@Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>"nested nested super type $localProp"<!>) Int>>() {
val prop = 0
@Anno("class $<!UNRESOLVED_REFERENCE!>prop<!>")
<!NESTED_CLASS_NOT_ALLOWED!>class InnerClass<!><@Anno("type param $<!UNRESOLVED_REFERENCE!>prop<!>") T : @Anno("bound $<!UNRESOLVED_REFERENCE!>prop<!>") List<@Anno("nested bound $<!UNRESOLVED_REFERENCE!>prop<!>") Int>> : @Anno("super type $<!UNRESOLVED_REFERENCE!>prop<!>") A<@Anno("nested super type $<!UNRESOLVED_REFERENCE!>prop<!>") List<@Anno("nested nested super type $<!UNRESOLVED_REFERENCE!>prop<!>") Int>>()
@Anno(<!NON_CONST_VAL_USED_IN_CONSTANT_EXPRESSION!>"class $prop"<!>)
<!NESTED_CLASS_NOT_ALLOWED!>class InnerClass<!><@Anno(<!NON_CONST_VAL_USED_IN_CONSTANT_EXPRESSION!>"type param $prop"<!>) T : @Anno(<!NON_CONST_VAL_USED_IN_CONSTANT_EXPRESSION!>"bound $prop"<!>) List<@Anno(<!NON_CONST_VAL_USED_IN_CONSTANT_EXPRESSION!>"nested bound $prop"<!>) Int>> : @Anno(<!NON_CONST_VAL_USED_IN_CONSTANT_EXPRESSION!>"super type $prop"<!>) A<@Anno(<!NON_CONST_VAL_USED_IN_CONSTANT_EXPRESSION!>"nested super type $prop"<!>) List<@Anno(<!NON_CONST_VAL_USED_IN_CONSTANT_EXPRESSION!>"nested nested super type $prop"<!>) Int>>()
}
}