[AA LC] Fix annotations on fields for enum entries
This commit is contained in:
+8
-1
@@ -17,6 +17,9 @@ import org.jetbrains.kotlin.light.classes.symbol.classes.SymbolLightClass
|
|||||||
import org.jetbrains.kotlin.light.classes.symbol.classes.SymbolLightClassForEnumEntry
|
import org.jetbrains.kotlin.light.classes.symbol.classes.SymbolLightClassForEnumEntry
|
||||||
import org.jetbrains.kotlin.light.classes.symbol.modifierLists.SymbolLightMemberModifierList
|
import org.jetbrains.kotlin.light.classes.symbol.modifierLists.SymbolLightMemberModifierList
|
||||||
import org.jetbrains.kotlin.light.classes.symbol.nonExistentType
|
import org.jetbrains.kotlin.light.classes.symbol.nonExistentType
|
||||||
|
import org.jetbrains.kotlin.descriptors.annotations.AnnotationUseSiteTarget
|
||||||
|
import org.jetbrains.kotlin.light.classes.symbol.NullabilityType
|
||||||
|
import org.jetbrains.kotlin.light.classes.symbol.annotations.computeAnnotations
|
||||||
import org.jetbrains.kotlin.psi.KtEnumEntry
|
import org.jetbrains.kotlin.psi.KtEnumEntry
|
||||||
import org.jetbrains.kotlin.utils.addToStdlib.ifTrue
|
import org.jetbrains.kotlin.utils.addToStdlib.ifTrue
|
||||||
|
|
||||||
@@ -31,7 +34,11 @@ internal class SymbolLightFieldForEnumEntry(
|
|||||||
SymbolLightMemberModifierList(
|
SymbolLightMemberModifierList(
|
||||||
containingDeclaration = this@SymbolLightFieldForEnumEntry,
|
containingDeclaration = this@SymbolLightFieldForEnumEntry,
|
||||||
modifiers = setOf(PsiModifier.STATIC, PsiModifier.FINAL, PsiModifier.PUBLIC),
|
modifiers = setOf(PsiModifier.STATIC, PsiModifier.FINAL, PsiModifier.PUBLIC),
|
||||||
annotations = emptyList()
|
annotations = enumEntrySymbol.computeAnnotations(
|
||||||
|
this,
|
||||||
|
nullability = NullabilityType.Unknown, // there is no need to add nullability annotations on enum entries
|
||||||
|
annotationUseSiteTarget = AnnotationUseSiteTarget.FIELD
|
||||||
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
|
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
|
||||||
|
public abstract @interface Some /* Some*/ {
|
||||||
|
}
|
||||||
|
|
||||||
public enum Direction /* Direction*/ {
|
public enum Direction /* Direction*/ {
|
||||||
NORTH,
|
@Some() NORTH,
|
||||||
SOUTH,
|
SOUTH,
|
||||||
WEST,
|
WEST,
|
||||||
EAST;
|
EAST;
|
||||||
|
|||||||
+6
-2
@@ -1,3 +1,7 @@
|
|||||||
|
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
|
||||||
|
public abstract @interface Some /* Some*/ {
|
||||||
|
}
|
||||||
|
|
||||||
public enum Direction /* Direction*/ {
|
public enum Direction /* Direction*/ {
|
||||||
NORTH,
|
NORTH,
|
||||||
SOUTH,
|
SOUTH,
|
||||||
@@ -68,7 +72,7 @@ public enum ProtocolState /* ProtocolState*/ {
|
|||||||
|
|
||||||
class WAITING ...
|
class WAITING ...
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final class WAITING /* ProtocolState.WAITING*/ extends ProtocolState {
|
public static final class WAITING /* ProtocolState.WAITING*/ extends ProtocolState {
|
||||||
WAITING();// .ctor()
|
WAITING();// .ctor()
|
||||||
@@ -118,7 +122,7 @@ public enum IntArithmetics /* IntArithmetics*/ implements java.util.function.Bin
|
|||||||
|
|
||||||
class TIMES ...
|
class TIMES ...
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final class PLUS /* IntArithmetics.PLUS*/ extends IntArithmetics {
|
public static final class PLUS /* IntArithmetics.PLUS*/ extends IntArithmetics {
|
||||||
PLUS();// .ctor()
|
PLUS();// .ctor()
|
||||||
|
|||||||
+3
-1
@@ -2,8 +2,10 @@
|
|||||||
|
|
||||||
import java.util.function.*
|
import java.util.function.*
|
||||||
|
|
||||||
|
annotation class Some
|
||||||
|
|
||||||
enum class Direction {
|
enum class Direction {
|
||||||
NORTH, SOUTH, WEST, EAST
|
@Some NORTH, SOUTH, WEST, EAST
|
||||||
}
|
}
|
||||||
|
|
||||||
enum class Color(val rgb: Int = 5) {
|
enum class Color(val rgb: Int = 5) {
|
||||||
|
|||||||
Reference in New Issue
Block a user