Add quickfix for replacing positioned arguments in Java annotation

This commit is contained in:
Denis Zharkov
2015-05-27 12:01:32 +03:00
parent 0c818767a6
commit 53e9234ea9
19 changed files with 184 additions and 8 deletions
@@ -0,0 +1,6 @@
// "Replace invalid positioned arguments for annotation" "true"
// WITH_RUNTIME
// ERROR: Only named arguments are available for Java annotations
// ERROR: Only named arguments are available for Java annotations
Ann(1, /*abc*/arg1 = "abc", arg2 = arrayOf(Int::class, Array<Int>::class), arg3 = String::class) class A
@@ -0,0 +1,6 @@
// "Replace invalid positioned arguments for annotation" "true"
// WITH_RUNTIME
// ERROR: Only named arguments are available for Java annotations
// ERROR: Only named arguments are available for Java annotations
Ann(1, /*abc*/"abc", arrayOf(Int::class, Array<Int>::class)<caret>, arg3 = String::class) class A
@@ -0,0 +1,7 @@
public @interface Ann {
int value();
String arg1();
Class<?>[] arg2();
Class<?> arg3();
int arg4() default 0;
}
@@ -0,0 +1,6 @@
// "Replace invalid positioned arguments for annotation" "true"
// WITH_RUNTIME
// ERROR: Only named arguments are available for Java annotations
// ERROR: No value passed for parameter arg2
Ann(1, arg1 = "abc") class A
@@ -0,0 +1,6 @@
// "Replace invalid positioned arguments for annotation" "true"
// WITH_RUNTIME
// ERROR: Only named arguments are available for Java annotations
// ERROR: No value passed for parameter arg2
Ann(1, "abc"<caret>) class A
@@ -0,0 +1,6 @@
public @interface Ann {
int value();
String arg1();
Class<?> arg2();
int arg3() default 0;
}
@@ -0,0 +1,6 @@
// "Replace invalid positioned arguments for annotation" "true"
// WITH_RUNTIME
// ERROR: Only named arguments are available for Java annotations
// ERROR: An integer literal does not conform to the expected type kotlin.String
Ann(1, arg1 = 2) class A
@@ -0,0 +1,6 @@
// "Replace invalid positioned arguments for annotation" "true"
// WITH_RUNTIME
// ERROR: Only named arguments are available for Java annotations
// ERROR: An integer literal does not conform to the expected type kotlin.String
Ann(1, 2<caret>) class A
@@ -0,0 +1,5 @@
public @interface Ann {
int value();
String arg1();
int arg2() default 0;
}