[KAPT] KT-64301 Report invalid enum value names
Merge-request: KT-MR-13520 Merged-by: Pavel Mikhailovskii <Pavel.Mikhailovskii@jetbrains.com>
This commit is contained in:
committed by
Space Team
parent
676e350b6f
commit
1015ae858e
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* public final annotation class Anno : kotlin/Annotation {
|
||||
*
|
||||
* // signature: <init>(LColor;)V
|
||||
* public constructor(color: Color)
|
||||
*
|
||||
* // getter: color()LColor;
|
||||
* public final val color: Color
|
||||
* public final get
|
||||
*
|
||||
* // module name: main
|
||||
* }
|
||||
*/
|
||||
@kotlin.Metadata()
|
||||
@Anno(color = Color.InvalidFieldName)
|
||||
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
|
||||
public abstract @interface Anno {
|
||||
|
||||
public abstract Color color();
|
||||
}
|
||||
|
||||
////////////////////
|
||||
|
||||
|
||||
/**
|
||||
* public final enum class Color : kotlin/Enum<Color> {
|
||||
*
|
||||
* // signature: <init>(Ljava/lang/String;I)V
|
||||
* private constructor()
|
||||
*
|
||||
* BLACK,
|
||||
*
|
||||
* WHI-TE,
|
||||
*
|
||||
* // module name: main
|
||||
*
|
||||
* // has Enum.entries
|
||||
* }
|
||||
*/
|
||||
@kotlin.Metadata()
|
||||
public enum Color {
|
||||
/*public static final*/ BLACK /* = new Color() */;
|
||||
|
||||
Color() {
|
||||
}
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public static kotlin.enums.EnumEntries<Color> getEntries() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
// FIR_BLOCKED: LC don't support illegal java identifiers
|
||||
enum class Color {
|
||||
BLACK, `WHI-TE`
|
||||
}
|
||||
@@ -6,5 +5,5 @@ enum class Color {
|
||||
@Anno(Color.`WHI-TE`)
|
||||
annotation class Anno(val color: Color)
|
||||
|
||||
// EXPECTED_ERROR: (kotlin:6:1) an enum annotation value must be an enum constant
|
||||
// EXPECTED_ERROR: (kotlin:5:1) an enum annotation value must be an enum constant
|
||||
// EXPECTED_ERROR: (other:-1:-1) 'WHI-TE' is an invalid Java enum value name
|
||||
|
||||
Reference in New Issue
Block a user