Fixed test data to use only annotation syntax with @

This commit is contained in:
Valentin Kipyatkov
2015-10-12 18:23:20 +03:00
parent 487501a7a4
commit 090ea37a32
83 changed files with 115 additions and 121 deletions
@@ -3,13 +3,7 @@ Buildfile: [TestData]/build.xml
build:
[kotlinc] Compiling [[TestData]] => [[Temp]]
[kotlinc] [TestData]/incorrectKotlinCode.kt:1:1: error: use '@' symbol before annotations
[kotlinc] xxxx
[kotlinc] ^
[kotlinc] [TestData]/incorrectKotlinCode.kt:1:5: error: expecting a top level declaration
[kotlinc] xxxx
[kotlinc] ^
[kotlinc] [TestData]/incorrectKotlinCode.kt:1:1: error: unresolved reference: xxxx
[kotlinc] [TestData]/incorrectKotlinCode.kt:1:1: error: expecting a top level declaration
[kotlinc] xxxx
[kotlinc] ^
@@ -11,7 +11,7 @@ fun test() {
~x~val x = 2
@[`zzz`zzz] fun local(
`zzz`zzz i: Int = `x`x,
@`zzz`zzz i: Int = `x`x,
j: Int = 3,
s: String = "$`x`x",
k: Int = `y`y,
@@ -1,4 +1,4 @@
`!null`first object Foo {}
@`!null`first object Foo {}
`!null`second(`!null`aa, `!null`asdf) object More {
@`!null`second(`!null`aa, `!null`asdf) object More {
}
@@ -7,4 +7,4 @@ class A(x: Double) {
}
}
<caret>A(1.0)
val v = <caret>A(1.0)
@@ -7,7 +7,7 @@ class A(x: Double) {
}
}
<caret>A(1.0)
val v = <caret>A(1.0)
Resolved call:
@@ -7,4 +7,4 @@ class A(x: Double) {
}
}
<caret>A("abc")
val v = <caret>A("abc")
@@ -7,7 +7,7 @@ class A(x: Double) {
}
}
<caret>A("abc")
val v = <caret>A("abc")
Resolved call:
@@ -7,4 +7,4 @@ class A() {
}
}
<caret>A()
val v = <caret>A()
@@ -7,7 +7,7 @@ class A() {
}
}
<caret>A()
val v = <caret>A()
Resolved call:
@@ -1,3 +1,3 @@
class A
<caret>A()
val v = <caret>A()
@@ -1,6 +1,6 @@
class A
<caret>A()
val v = <caret>A()
Resolved call:
@@ -7,4 +7,4 @@ class A {
}
}
<caret>A("abc")
val v = <caret>A("abc")
@@ -7,7 +7,7 @@ class A {
}
}
<caret>A("abc")
val v = <caret>A("abc")
Resolved call:
@@ -7,4 +7,4 @@ class A {
}
}
<caret>A(1)
val v = <caret>A(1)
@@ -7,7 +7,7 @@ class A {
}
}
<caret>A(1)
val v = <caret>A(1)
Resolved call:
@@ -7,4 +7,4 @@ class A {
}
}
<caret>A(1, "abc")
val v = <caret>A(1, "abc")
@@ -7,7 +7,7 @@ class A {
}
}
<caret>A(1, "abc")
val v = <caret>A(1, "abc")
Resolved call:
@@ -7,4 +7,4 @@ class A {
}
}
<caret>A(1.0)
val v = <caret>A(1.0)
@@ -7,7 +7,7 @@ class A {
}
}
<caret>A(1.0)
val v = <caret>A(1.0)
Resolved call:
@@ -7,4 +7,4 @@ class A {
}
}
<caret>A(x=1.0)
val v = <caret>A(x=1.0)
@@ -7,7 +7,7 @@ class A {
}
}
<caret>A(x=1.0)
val v = <caret>A(x=1.0)
Resolved call:
@@ -4,4 +4,4 @@ class A {
}
}
<caret>A(1)
val v = <caret>A(1)
@@ -4,7 +4,7 @@ class A {
}
}
<caret>A(1)
val v = <caret>A(1)
Resolved call:
@@ -1,5 +1,5 @@
class A {
pl<caret>
@pl<caret>
}
// ELEMENT: platformStatic
@@ -1,7 +1,7 @@
import kotlin.platform.platformStatic
class A {
platformStatic<caret>
@platformStatic<caret>
}
// ELEMENT: platformStatic
@@ -1,6 +1,6 @@
class A {
companion object {
pl<caret>
@pl<caret>
}
}
@@ -2,7 +2,7 @@ import kotlin.platform.platformStatic
class A {
companion object {
platformStatic<caret>
@platformStatic<caret>
}
}
@@ -8,7 +8,7 @@ class Foo {
fun f() {
}
platformStatic fun s() {
@platformStatic fun s() {
}
val CONST = 42
@@ -2,7 +2,7 @@ package client
import server.X
X("")
@X("")
class Client {
}
@@ -1,2 +1,2 @@
Annotation (5: 1) X("")
Annotation (5: 2) @X("")
Usage in import (3: 15) import server.X
+2 -2
View File
@@ -16,10 +16,10 @@ class A {
}
Ann init {
@Ann init {
}
Ann init {
@Ann init {
}
+2 -2
View File
@@ -9,8 +9,8 @@ class A {
fun foo2() {
}
Ann init {}
Ann init {}
@Ann init {}
@Ann init {}
fun foo3() {
+4 -4
View File
@@ -64,7 +64,7 @@ annotation class A1
annotation class A2
private @[A1 A2 A1] A1 A2 @[A1 A2 A2] @[A1] val fooProp1 = 1
private @[A1 A2 A1] @A1 @A2 @[A1 A2 A2] @[A1] val fooProp1 = 1
private @[
@@ -72,7 +72,7 @@ private @[
A1
A2 A1] A1 A2 @[A1
A2 A1] @A1 @A2 @[A1
A2
@@ -80,9 +80,9 @@ A2
] @[A1] val fooProp1 = 1
private A1
private @A1
A2 val
@A2 val
fooProp2 = 1
+4 -4
View File
@@ -61,7 +61,7 @@ public var varWithAccessors2: Int
annotation class A1
annotation class A2
private @[ A1 A2 A1 ] A1 A2 @[ A1 A2 A2 ] @[A1] val fooProp1 = 1
private @[ A1 A2 A1 ] @A1 @A2 @[ A1 A2 A2 ] @[A1] val fooProp1 = 1
private @[
@@ -69,7 +69,7 @@ private @[
A1
A2 A1 ] A1 A2 @[A1
A2 A1 ] @A1 @A2 @[A1
A2
@@ -79,9 +79,9 @@ A2
] @[A1] val fooProp1 = 1
private A1
private @A1
A2 val
@A2 val
fooProp2 = 1
@@ -1,4 +1,4 @@
<caret>A class MyClass
@<caret>A class MyClass
annotation class A
@@ -1,7 +1,7 @@
annotation class native
native fun withNativeAnnotation() {
@native fun withNativeAnnotation() {
}
native class WithNativeAnnotation
@native class WithNativeAnnotation
@@ -5,7 +5,7 @@ package entryPoint
import kotlin.platform.platformStatic
object EntryPoint {
platformStatic public fun main(args: Array<String>) {
@platformStatic public fun main(args: Array<String>) {
}
}
@@ -4,7 +4,7 @@ annotation class X(val s: String)
class A(val n: Int) {
val t = 1
internal X("1") fun <T : Number> T.<caret>foo(): Boolean = toInt() - n > 1
internal @X("1") fun <T : Number> T.<caret>foo(): Boolean = toInt() - n > 1
val u = 2
}
@@ -4,7 +4,7 @@ annotation class X(val s: String)
class A(val n: Int) {
val t = 1
internal X("1") val <T : Number> T.foo: Boolean
internal @X("1") val <T : Number> T.foo: Boolean
get() = toInt() - n > 1
val u = 2
}
@@ -3,7 +3,7 @@
annotation class X(val s: String)
class A(val n: Int) {
internal X("1") val <T : Number> T.<caret>foo: Boolean
internal @X("1") val <T : Number> T.<caret>foo: Boolean
get() = toInt() - n > 1
}
@@ -3,7 +3,7 @@
annotation class X(val s: String)
class A(val n: Int) {
internal X("1") fun <T : Number> T.getFoo(): Boolean = toInt() - n > 1
internal @X("1") fun <T : Number> T.getFoo(): Boolean = toInt() - n > 1
}
fun test() {
+1 -1
View File
@@ -1,4 +1,4 @@
Deprecated("") fun f(x: Int) = 2
@Deprecated("") fun f(x: Int) = 2
fun f(x: Int, y: Boolean) = 3
fun d(x: Int) {
@@ -1,5 +1,5 @@
// "Create annotation 'foo'" "true"
<caret>foo(1, "2") fun test() {
@<caret>foo(1, "2") fun test() {
}
@@ -1,6 +1,6 @@
// "Create annotation 'foo'" "true"
foo(1, "2") fun test() {
@foo(1, "2") fun test() {
}
@@ -1,6 +1,6 @@
// "Create annotation 'foo'" "true"
// ERROR: Unresolved reference: foo
J.foo(1, "2") fun test() {
@J.foo(1, "2") fun test() {
}
@@ -1,6 +1,6 @@
// "Create annotation 'foo'" "true"
// ERROR: Unresolved reference: foo
J.<caret>foo(1, "2") fun test() {
@J.<caret>foo(1, "2") fun test() {
}
@@ -1,6 +1,6 @@
// "Create annotation 'foo'" "true"
// ERROR: Unresolved reference: foo
J.foo(count = 1, name = "2") fun test() {
@J.foo(count = 1, name = "2") fun test() {
}
@@ -1,6 +1,6 @@
// "Create annotation 'foo'" "true"
// ERROR: Unresolved reference: foo
J.<caret>foo(count = 1, name = "2") fun test() {
@J.<caret>foo(count = 1, name = "2") fun test() {
}
@@ -3,4 +3,4 @@
// 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
@Ann(1, /*abc*/arg1 = "abc", arg2 = arrayOf(Int::class, Array<Int>::class), arg3 = String::class) class A
@@ -3,4 +3,4 @@
// 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
@Ann(1, /*abc*/"abc", arrayOf(Int::class, Array<Int>::class)<caret>, arg3 = String::class) class A
@@ -3,4 +3,4 @@
// ERROR: Only named arguments are available for Java annotations
// ERROR: No value passed for parameter arg2
Ann(1, arg1 = "abc") class A
@Ann(1, arg1 = "abc") class A
@@ -3,4 +3,4 @@
// ERROR: Only named arguments are available for Java annotations
// ERROR: No value passed for parameter arg2
Ann(1, "abc"<caret>) class A
@Ann(1, "abc"<caret>) class A
@@ -3,4 +3,4 @@
// 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
@Ann(1, arg1 = 2) class A
@@ -3,4 +3,4 @@
// 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
@Ann(1, 2<caret>) class A
@@ -34,7 +34,7 @@ fun run(block: () -> Unit) = block()
annotation class ann
notLabelAnnotation class A {
@notLabelAnnotation class A {
fun foo() {
loop@
for (i in 1..100) {
@@ -34,7 +34,7 @@ fun run(block: () -> Unit) = block()
annotation class ann
notLabelAnnotation class A {
@notLabelAnnotation class A {
fun foo() {
@loop<caret>
for (i in 1..100) {
@@ -1,5 +1,5 @@
// "Suppress 'REDUNDANT_NULLABLE' for fun foo" "true"
ann fun foo(): String?<caret>? = null
@ann fun foo(): String?<caret>? = null
annotation class ann
@@ -1,6 +1,6 @@
// "Suppress 'REDUNDANT_NULLABLE' for fun foo" "true"
@Suppress("REDUNDANT_NULLABLE")
ann fun foo(): String?<caret>? = null
@ann fun foo(): String?<caret>? = null
annotation class ann
@@ -1,4 +1,4 @@
class C {
deprecated(<selection>""</selection>)
@deprecated(<selection>""</selection>)
init {}
}
@@ -2,6 +2,6 @@ package testing.rename
public open class C {
companion object {
JvmStatic fun second() {}
@JvmStatic fun second() {}
}
}
@@ -2,6 +2,6 @@ package testing.rename
public open class C {
companion object {
JvmStatic fun first() {}
@JvmStatic fun first() {}
}
}
+1 -1
View File
@@ -2,6 +2,6 @@ package test
annotation class Annotation
<caret>Annotation class Some
@<caret>Annotation class Some
// REF: (test).Annotation
@@ -1,4 +1,4 @@
java.lang.annotation.Retention(va<caret>lue = java.lang.annotation.RetentionPolicy.RUNTIME)
@java.lang.annotation.Retention(va<caret>lue = java.lang.annotation.RetentionPolicy.RUNTIME)
annotation class Anno()
// REF: (in java.lang.annotation.Retention).value()
+1 -1
View File
@@ -1,4 +1,4 @@
java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.R<caret>UNTIME)
@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.R<caret>UNTIME)
annotation class Anno()
// REF: (in java.lang.annotation.RetentionPolicy).RUNTIME
@@ -2,7 +2,7 @@ package testing
object Testing {
companion object {
<caret>va
@<caret>va
}
}
+4 -4
View File
@@ -5,7 +5,7 @@ import kotlin.platform.platformStatic
// RUN: q.Foo
object Foo {
// RUN: q.Foo
platformStatic fun main(s: Array<String>) {
@platformStatic fun main(s: Array<String>) {
println("Foo")
}
@@ -13,7 +13,7 @@ object Foo {
class InnerFoo {
companion object {
// RUN: q.Foo.InnerFoo
platformStatic fun main(s: Array<String>) {
@platformStatic fun main(s: Array<String>) {
println("InnerFoo")
}
}
@@ -22,7 +22,7 @@ object Foo {
// RUN: q.Foo
class InnerFoo2 {
// RUN: q.Foo
platformStatic fun main(s: Array<String>) {
@platformStatic fun main(s: Array<String>) {
println("InnerFoo")
}
}
@@ -40,7 +40,7 @@ object Foo2 {
class Bar {
companion object {
// RUN: q.Bar
platformStatic fun main(s: Array<String>) {
@platformStatic fun main(s: Array<String>) {
println("Bar")
}
}
+2 -2
View File
@@ -1,6 +1,6 @@
package q
native
@native
class Foo {
// RUN:
fun foo(s: Array<String>) = noImpl
@@ -8,7 +8,7 @@ class Foo {
// RUN:
native
@native
fun main(s: Array<String>) {
println("Top-level")
}
+5 -5
View File
@@ -5,7 +5,7 @@ import kotlin.platform.platformStatic
class A {
companion object {
platformStatic
@platformStatic
fun main(args: Array<String>) {
// yes
}
@@ -22,8 +22,8 @@ class B {
class C {
companion object {
platformStatic
platformName("main0")
@platformStatic
@platformName("main0")
fun main(args: Array<String>) { // no
}
}
@@ -31,8 +31,8 @@ class C {
class D {
companion object {
platformStatic
platformName("main")
@platformStatic
@platformName("main")
fun badName(args: Array<String>) { // yes
}
}
@@ -2,7 +2,7 @@ package pkg2
import kotlin.platform.platformName
platformName("aa")
@platformName("aa")
fun main(args: Array<String>) {
// no
}
@@ -2,7 +2,7 @@ package pkg3
import kotlin.platform.platformName
platformName("main")
@platformName("main")
fun aaa(args: Array<String>) {
// yes
}
+1 -1
View File
@@ -3,6 +3,6 @@ package renameTest
import kotlin.platform.platformStatic
object Foo {
platformStatic fun main(args: Array<String>) {
@platformStatic fun main(args: Array<String>) {
}
}
@@ -3,6 +3,6 @@ package renameTest
import kotlin.platform.platformStatic
object Foo {
platformStatic fun main(args: Array<String>) {
@platformStatic fun main(args: Array<String>) {
}
}
+3 -3
View File
@@ -2,12 +2,12 @@
@java.lang.Deprecated class TestClass2 {}
java.lang.Deprecated class TestClass3 {}
@java.lang.Deprecated class TestClass3 {}
java.lang.Deprecated class TestClass4 {}
@java.lang.Deprecated class TestClass4 {}
class TestClass5 {
java.lang.Deprecated class innerTestClass5() {}
@java.lang.Deprecated class innerTestClass5() {}
}
// ANNOTATION: java.lang.Deprecated
@@ -1,29 +1,29 @@
java.lang.Deprecated fun test1() {}
@java.lang.Deprecated fun test1() {}
java.lang.Deprecated fun test2() {}
@java.lang.Deprecated fun test2() {}
fun test3() {
java.lang.Deprecated fun test3inner() {}
@java.lang.Deprecated fun test3inner() {}
}
class Test4() {
java.lang.Deprecated fun test4() {}
@java.lang.Deprecated fun test4() {}
}
class Test5() {
fun test5() {
java.lang.Deprecated fun test5inner() {}
@java.lang.Deprecated fun test5inner() {}
}
}
class Test6() {
companion object {
java.lang.Deprecated fun test6() {}
@java.lang.Deprecated fun test6() {}
}
}
object Test7 {
java.lang.Deprecated fun test7() {}
@java.lang.Deprecated fun test7() {}
}
// ANNOTATION: java.lang.Deprecated
@@ -1,8 +1,8 @@
MyAnnotation("f", "s") fun test1() {}
@MyAnnotation("f", "s") fun test1() {}
MyAnnotation("f", "s") class Test1() {}
@MyAnnotation("f", "s") class Test1() {}
MyAnnotation("f", "s") val test3 = 1
@MyAnnotation("f", "s") val test3 = 1
annotation class MyAnnotation(val first: String, val second: String)
+2 -2
View File
@@ -3,11 +3,11 @@ import org.junit.Test
class MyTestClass {
@org.junit.Test fun test1() {}
org.junit.Test fun test2() {}
@org.junit.Test fun test2() {}
@Test fun test3() {}
Test fun test4() {}
@Test fun test4() {}
@Deprecated @org.junit.Test fun test5() {}
+2 -2
View File
@@ -2,11 +2,11 @@ import org.junit.Test as test
import org.junit.Test
class MyTestClass {
test fun test1() {}
@test fun test1() {}
@Deprecated @test fun test2() {}
Test fun test3() {}
@Test fun test3() {}
}
// ANNOTATION: org.junit.Test
+2 -2
View File
@@ -2,11 +2,11 @@ import org.junit.Test as unittest
import org.junit.Test
class MyTestClass {
unittest fun test1() {}
@unittest fun test1() {}
@Deprecated @unittest fun test2() {}
Test fun test3() {}
@Test fun test3() {}
}
// ANNOTATION: org.junit.Test
+1 -1
View File
@@ -1,2 +1,2 @@
Deprecated class Test {
@Deprecated class Test {
}
+1 -1
View File
@@ -1,2 +1,2 @@
Deprecated fun foo() {
@Deprecated fun foo() {
}
+1 -1
View File
@@ -1,2 +1,2 @@
java.lang.Deprecated fun foo() {
@java.lang.Deprecated fun foo() {
}
+2 -2
View File
@@ -4,7 +4,7 @@ class SecondaryConstructors(x: Boolean) {
init {
}
anno constructor(x: String) : this(x == "abc") {
@anno constructor(x: String) : this(x == "abc") {
}
init {
@@ -19,7 +19,7 @@ class SecondaryConstructors(x: Boolean) {
}
class Nested {
anno constructor(z: Int) {}
@anno constructor(z: Int) {}
internal constructor() {}
}
}
@@ -269,7 +269,7 @@ class C(param1: String = "", param2: Int = 0) {
public fun testAnnotationEntry() {
val file = myFixture.configureByText("Test.kt", """
annotation class A
A class B {}
@A class B {}
""") as JetFile
val klass = file.getDeclarations()[1] as JetClass