summaryrefslogtreecommitdiff
path: root/test/files/neg
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2012-12-12 15:58:58 -0800
committerAdriaan Moors <adriaan.moors@typesafe.com>2012-12-12 15:58:58 -0800
commit7968f935d7af448e3dec23860b47394e7fd057bb (patch)
tree91c718fa774d1f9e325488f9d1a5338812090abd /test/files/neg
parenta6f10cf7f4245f2dfcf2fef5fab5255b6fca119f (diff)
parent089173d14544ee622f65fa1c9ce30d98414e8cdb (diff)
downloadscala-7968f935d7af448e3dec23860b47394e7fd057bb.tar.gz
scala-7968f935d7af448e3dec23860b47394e7fd057bb.tar.bz2
scala-7968f935d7af448e3dec23860b47394e7fd057bb.zip
Merge pull request #1747 from hubertp/2.10.x-issue/6758
Fixes SI-6758: force LazyAnnnotationInfo for DefDef and TypeDef
Diffstat (limited to 'test/files/neg')
-rw-r--r--test/files/neg/t3222.check14
-rw-r--r--test/files/neg/t6558.check6
-rw-r--r--test/files/neg/t6558.scala15
-rw-r--r--test/files/neg/t6758.check28
-rw-r--r--test/files/neg/t6758.scala43
5 files changed, 84 insertions, 22 deletions
diff --git a/test/files/neg/t3222.check b/test/files/neg/t3222.check
index e724024f45..6170827cc9 100644
--- a/test/files/neg/t3222.check
+++ b/test/files/neg/t3222.check
@@ -1,7 +1,13 @@
-t3222.scala:4: error: not found: type D
- def foo(@throws(classOf[D]) x: Int) {}
- ^
t3222.scala:1: error: not found: type B
@throws(classOf[B])
^
-two errors found
+t3222.scala:4: error: not found: type D
+ def foo(@throws(classOf[D]) x: Int) {}
+ ^
+t3222.scala:3: error: not found: type C
+ @throws(classOf[C])
+ ^
+t3222.scala:6: error: not found: type E
+ @throws(classOf[E])
+ ^
+four errors found
diff --git a/test/files/neg/t6558.check b/test/files/neg/t6558.check
index 1b39ef9986..6ad3cecd50 100644
--- a/test/files/neg/t6558.check
+++ b/test/files/neg/t6558.check
@@ -1,10 +1,10 @@
-t6558.scala:19: error: not found: type classs
+t6558.scala:4: error: not found: type classs
@classs
^
-t6558.scala:22: error: not found: type typeparam
+t6558.scala:7: error: not found: type typeparam
class D[@typeparam T]
^
-t6558.scala:25: error: not found: type valueparam
+t6558.scala:10: error: not found: type valueparam
@valueparam x: Any
^
three errors found
diff --git a/test/files/neg/t6558.scala b/test/files/neg/t6558.scala
index bdc441698f..b4304ff686 100644
--- a/test/files/neg/t6558.scala
+++ b/test/files/neg/t6558.scala
@@ -1,21 +1,6 @@
class AnnotNotFound {
def foo(a: Any) = ()
- foo {
- // Not yet issued in the context of this file, see SI-6758
- // This error is issued in t6558b.scala
- @inargument
- def foo = 0
- foo
- }
-
- () => {
- // As per above
- @infunction
- def foo = 0
- ()
- }
-
@classs
class C
diff --git a/test/files/neg/t6758.check b/test/files/neg/t6758.check
new file mode 100644
index 0000000000..2cdd6b8ae5
--- /dev/null
+++ b/test/files/neg/t6758.check
@@ -0,0 +1,28 @@
+t6758.scala:5: error: not found: type inargument
+ @inargument
+ ^
+t6758.scala:11: error: not found: type infunction
+ @infunction
+ ^
+t6758.scala:18: error: not found: type nested
+ @nested
+ ^
+t6758.scala:25: error: not found: type param
+ def func(@param x: Int): Int = 0
+ ^
+t6758.scala:28: error: not found: type typealias
+ @typealias
+ ^
+t6758.scala:32: error: not found: type classs
+ @classs
+ ^
+t6758.scala:35: error: not found: type module
+ @module
+ ^
+t6758.scala:38: error: not found: type typeparam
+ class D[@typeparam T]
+ ^
+t6758.scala:41: error: not found: type valueparam
+ @valueparam x: Any
+ ^
+9 errors found
diff --git a/test/files/neg/t6758.scala b/test/files/neg/t6758.scala
new file mode 100644
index 0000000000..acf333bf90
--- /dev/null
+++ b/test/files/neg/t6758.scala
@@ -0,0 +1,43 @@
+class AnnotNotFound {
+ def foo(a: Any) = ()
+
+ foo {
+ @inargument
+ def foo = 0
+ foo
+ }
+
+ () => {
+ @infunction
+ def foo = 0
+ ()
+ }
+
+ () => {
+ val bar: Int = {
+ @nested
+ val bar2: Int = 2
+ 2
+ }
+ ()
+ }
+
+ def func(@param x: Int): Int = 0
+
+ abstract class A {
+ @typealias
+ type B = Int
+ }
+
+ @classs
+ class C
+
+ @module
+ object D
+
+ class D[@typeparam T]
+
+ class E(
+ @valueparam x: Any
+ )
+}