Kapt3: Ignore declarations with illegal Java identifiers (KT-16153)
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
class `:)` {
|
||||
lateinit val f: String
|
||||
}
|
||||
|
||||
// Commented declarations won't compile with the current Kotlin
|
||||
class Test {
|
||||
class `(^_^)`
|
||||
|
||||
lateinit val simpleName: String
|
||||
lateinit val `strange name`: String
|
||||
// lateinit val strangeType: List<`!A@`>
|
||||
|
||||
fun simpleFun() {}
|
||||
|
||||
@Anno(name = "Woofwoof", size = StrangeEnum.`60x60`, `A B` = "S")
|
||||
fun simpleFun2(a: String, b: String) {}
|
||||
|
||||
fun `strange!Fun`() {}
|
||||
// fun strangeFun2(a: String, b: `A()B()`) {}
|
||||
// fun strangeFun3(a: String, b: `A B`) {}
|
||||
fun strangeFun4(a: String, `A()B()`: String) {}
|
||||
// fun strangeFun5(a: `A B`.C) {}
|
||||
}
|
||||
|
||||
enum class StrangeEnum(val size: String) {
|
||||
`60x60`("60x60"),
|
||||
`70x70`("70x70"),
|
||||
`80x80`("80x80"),
|
||||
InvalidFieldName("0x0") // Workaround to pass javac analysis
|
||||
}
|
||||
|
||||
annotation class Anno(val size: StrangeEnum, val name: String, val `A B`: String)
|
||||
|
||||
class `!A@`
|
||||
class `A()B()`
|
||||
class `A B` {
|
||||
class C
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
|
||||
public abstract @interface Anno {
|
||||
|
||||
public abstract StrangeEnum size();
|
||||
|
||||
public abstract java.lang.String name();
|
||||
}
|
||||
|
||||
////////////////////
|
||||
|
||||
|
||||
public enum StrangeEnum {
|
||||
/*public static final*/ InvalidFieldName /* = new InvalidFieldName(null) */;
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
private final java.lang.String size = null;
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public final java.lang.String getSize() {
|
||||
return null;
|
||||
}
|
||||
|
||||
StrangeEnum(@org.jetbrains.annotations.NotNull()
|
||||
java.lang.String size) {
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////
|
||||
|
||||
|
||||
public final class Test {
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public java.lang.String simpleName;
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public final java.lang.String getSimpleName() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public final void simpleFun() {
|
||||
}
|
||||
|
||||
@Anno(name = "Woofwoof", size = StrangeEnum.InvalidFieldName)
|
||||
public final void simpleFun2(@org.jetbrains.annotations.NotNull()
|
||||
java.lang.String a, @org.jetbrains.annotations.NotNull()
|
||||
java.lang.String b) {
|
||||
}
|
||||
|
||||
public final void strangeFun4(@org.jetbrains.annotations.NotNull()
|
||||
java.lang.String a, @org.jetbrains.annotations.NotNull()
|
||||
java.lang.String p1_1899121793) {
|
||||
}
|
||||
|
||||
public Test() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@@ -1,26 +1 @@
|
||||
public final class My $ name {
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
private final java.lang.String (@\u2022@) = "";
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
private final java.lang.String \u041a\u043e\u0442\u043b\u0438\u043d-\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 = "";
|
||||
|
||||
public final void (^_^)(int )))))) {
|
||||
}
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public final java.lang.String get(@\u2022@)() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public final java.lang.String get\u041a\u043e\u0442\u043b\u0438\u043d-\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public final void \u3053\u3000\u3068\u3000\u308a\u3000\u3093\uff01() {
|
||||
}
|
||||
|
||||
public My $ name() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user