[FIR] Don't miss annotations on for loops variables
^KT-59874
This commit is contained in:
committed by
Space Team
parent
d03039b949
commit
63f461a6cd
+2
-1
@@ -1205,7 +1205,8 @@ class LightTreeRawFirExpressionBuilder(
|
||||
}
|
||||
explicitReceiver = generateResolvedAccessExpression(rangeSource, iteratorVal)
|
||||
},
|
||||
valueParameter.returnTypeRef
|
||||
valueParameter.returnTypeRef,
|
||||
extractedAnnotations = valueParameter.annotations
|
||||
)
|
||||
if (multiDeclaration != null) {
|
||||
statements.addDestructuringStatements(
|
||||
|
||||
@@ -2645,6 +2645,7 @@ open class PsiRawFirBuilder(
|
||||
explicitReceiver = generateResolvedAccessExpression(rangeSource, iteratorVal)
|
||||
},
|
||||
typeRef = ktParameter.typeReference.toFirOrImplicitType(),
|
||||
extractedAnnotations = ktParameter.modifierList?.annotationEntries?.map { it.convert<FirAnnotation>() },
|
||||
)
|
||||
if (multiDeclaration != null) {
|
||||
blockBuilder.statements.addDestructuringStatements(
|
||||
|
||||
+1
-1
@@ -10,5 +10,5 @@ fun foo() {
|
||||
|
||||
for (@Ann(3) (x, @Ann(4) y) in bar()) {}
|
||||
|
||||
for (@Err() (x,y) in bar()) {}
|
||||
for (@<!UNRESOLVED_REFERENCE!>Err<!>() (x,y) in bar()) {}
|
||||
}
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
// See KT-9145
|
||||
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
annotation class Ann
|
||||
|
||||
fun foo() {
|
||||
for (@Ann <!WRONG_MODIFIER_TARGET!>private<!> x in 1..100) {
|
||||
if (x == 1) return
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// See KT-9145
|
||||
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
Reference in New Issue
Block a user