FIR2IR: fix the way annotations are moved to fields

1. When an annotation has multiple targets, the priority goes like this:
    constructor parameter (if applicable) -> property -> backing field.

 2. The argument to `kotlin.annotation.Target` is a vararg, so that
    should be handled as well.

 3. `AnnotationTarget.VALUE_PARAMETER` allows receivers, constructor
    parameters, and setter parameters, while `AnnotationTarget.FIELD` allows
    both backing fields and delegates.

Known issue: java.lang.annotation.Target is not remapped to the Kotlin
equivalent, so things are still broken for pure Java annotations.
This commit is contained in:
pyos
2020-11-27 14:13:04 +01:00
committed by TeamCityServer
parent 4817d5e01d
commit 50ae360ff9
3 changed files with 81 additions and 89 deletions
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_REFLECT
// TARGET_BACKEND: JVM