[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;
|
||||||
|
|||||||
+16
-12
@@ -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,
|
||||||
@@ -37,14 +41,14 @@ public enum Color /* Color*/ {
|
|||||||
|
|
||||||
public enum ProtocolState /* ProtocolState*/ {
|
public enum ProtocolState /* ProtocolState*/ {
|
||||||
WAITING {
|
WAITING {
|
||||||
WAITING();// .ctor()
|
WAITING();// .ctor()
|
||||||
|
|
||||||
@org.jetbrains.annotations.NotNull()
|
@org.jetbrains.annotations.NotNull()
|
||||||
public ProtocolState signal();// signal()
|
public ProtocolState signal();// signal()
|
||||||
|
|
||||||
},
|
},
|
||||||
TALKING {
|
TALKING {
|
||||||
TALKING();// .ctor()
|
TALKING();// .ctor()
|
||||||
|
|
||||||
@org.jetbrains.annotations.NotNull()
|
@org.jetbrains.annotations.NotNull()
|
||||||
public ProtocolState signal();// signal()
|
public ProtocolState signal();// signal()
|
||||||
@@ -66,12 +70,12 @@ public enum ProtocolState /* ProtocolState*/ {
|
|||||||
|
|
||||||
class TALKING ...
|
class TALKING ...
|
||||||
|
|
||||||
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()
|
||||||
|
|
||||||
@org.jetbrains.annotations.NotNull()
|
@org.jetbrains.annotations.NotNull()
|
||||||
public ProtocolState signal();// signal()
|
public ProtocolState signal();// signal()
|
||||||
@@ -79,7 +83,7 @@ public static final class WAITING /* ProtocolState.WAITING*/ extends ProtocolSta
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static final class TALKING /* ProtocolState.TALKING*/ extends ProtocolState {
|
public static final class TALKING /* ProtocolState.TALKING*/ extends ProtocolState {
|
||||||
TALKING();// .ctor()
|
TALKING();// .ctor()
|
||||||
|
|
||||||
@org.jetbrains.annotations.NotNull()
|
@org.jetbrains.annotations.NotNull()
|
||||||
public ProtocolState signal();// signal()
|
public ProtocolState signal();// signal()
|
||||||
@@ -88,14 +92,14 @@ public static final class TALKING /* ProtocolState.TALKING*/ extends ProtocolSta
|
|||||||
|
|
||||||
public enum IntArithmetics /* IntArithmetics*/ implements java.util.function.BinaryOperator<java.lang.Integer>, java.util.function.IntBinaryOperator {
|
public enum IntArithmetics /* IntArithmetics*/ implements java.util.function.BinaryOperator<java.lang.Integer>, java.util.function.IntBinaryOperator {
|
||||||
PLUS {
|
PLUS {
|
||||||
PLUS();// .ctor()
|
PLUS();// .ctor()
|
||||||
|
|
||||||
@org.jetbrains.annotations.NotNull()
|
@org.jetbrains.annotations.NotNull()
|
||||||
public java.lang.Integer apply(int, int);// apply(int, int)
|
public java.lang.Integer apply(int, int);// apply(int, int)
|
||||||
|
|
||||||
},
|
},
|
||||||
TIMES {
|
TIMES {
|
||||||
TIMES();// .ctor()
|
TIMES();// .ctor()
|
||||||
|
|
||||||
@org.jetbrains.annotations.NotNull()
|
@org.jetbrains.annotations.NotNull()
|
||||||
public java.lang.Integer apply(int, int);// apply(int, int)
|
public java.lang.Integer apply(int, int);// apply(int, int)
|
||||||
@@ -116,12 +120,12 @@ public enum IntArithmetics /* IntArithmetics*/ implements java.util.function.Bin
|
|||||||
|
|
||||||
class PLUS ...
|
class PLUS ...
|
||||||
|
|
||||||
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()
|
||||||
|
|
||||||
@org.jetbrains.annotations.NotNull()
|
@org.jetbrains.annotations.NotNull()
|
||||||
public java.lang.Integer apply(int, int);// apply(int, int)
|
public java.lang.Integer apply(int, int);// apply(int, int)
|
||||||
@@ -129,7 +133,7 @@ public static final class PLUS /* IntArithmetics.PLUS*/ extends IntArithmetics {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static final class TIMES /* IntArithmetics.TIMES*/ extends IntArithmetics {
|
public static final class TIMES /* IntArithmetics.TIMES*/ extends IntArithmetics {
|
||||||
TIMES();// .ctor()
|
TIMES();// .ctor()
|
||||||
|
|
||||||
@org.jetbrains.annotations.NotNull()
|
@org.jetbrains.annotations.NotNull()
|
||||||
public java.lang.Integer apply(int, int);// apply(int, int)
|
public java.lang.Integer apply(int, int);// apply(int, int)
|
||||||
|
|||||||
+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