diff options
Diffstat (limited to 'test/files/neg')
-rw-r--r-- | test/files/neg/macro-cyclic.check | 8 | ||||
-rw-r--r-- | test/files/neg/macro-cyclic/Impls_Macros_1.scala | 2 | ||||
-rw-r--r-- | test/files/neg/static-annot.check | 19 | ||||
-rw-r--r-- | test/files/neg/static-annot.scala | 47 | ||||
-rw-r--r-- | test/files/neg/t4069.check | 2 | ||||
-rw-r--r-- | test/files/neg/t4425.check | 5 | ||||
-rw-r--r-- | test/files/neg/t4584.check | 7 | ||||
-rw-r--r-- | test/files/neg/t5856.check | 31 | ||||
-rw-r--r-- | test/files/neg/t5856.scala | 11 | ||||
-rw-r--r-- | test/files/neg/t5892.check | 17 | ||||
-rw-r--r-- | test/files/neg/t5892.scala | 25 | ||||
-rw-r--r-- | test/files/neg/unicode-unterminated-quote.check | 5 |
12 files changed, 168 insertions, 11 deletions
diff --git a/test/files/neg/macro-cyclic.check b/test/files/neg/macro-cyclic.check index 608381e0e8..7978ec64a5 100644 --- a/test/files/neg/macro-cyclic.check +++ b/test/files/neg/macro-cyclic.check @@ -1,4 +1,4 @@ -Impls_Macros_1.scala:5: error: could not find implicit value for parameter e: SourceLocation
- c.reify { implicitly[SourceLocation] }
- ^
-one error found
+Impls_Macros_1.scala:5: error: could not find implicit value for parameter e: SourceLocation + c.universe.reify { implicitly[SourceLocation] } + ^ +one error found diff --git a/test/files/neg/macro-cyclic/Impls_Macros_1.scala b/test/files/neg/macro-cyclic/Impls_Macros_1.scala index 1ea06fc968..2ecdc3416e 100644 --- a/test/files/neg/macro-cyclic/Impls_Macros_1.scala +++ b/test/files/neg/macro-cyclic/Impls_Macros_1.scala @@ -2,7 +2,7 @@ import scala.reflect.makro.Context object Macros { def impl(c: Context) = { - c.reify { implicitly[SourceLocation] } + c.universe.reify { implicitly[SourceLocation] } } implicit def sourceLocation: SourceLocation1 = macro impl diff --git a/test/files/neg/static-annot.check b/test/files/neg/static-annot.check new file mode 100644 index 0000000000..66efebdcee --- /dev/null +++ b/test/files/neg/static-annot.check @@ -0,0 +1,19 @@ +static-annot.scala:8: error: Only members of top-level objects and their nested objects can be annotated with @static. + @static val bar = 1 + ^ +static-annot.scala:27: error: @static annotated field bar has the same name as a member of class Conflicting + @static val bar = 1 + ^ +static-annot.scala:37: error: The @static annotation is only allowed on public members. + @static private val bar = 1 + ^ +static-annot.scala:38: error: The @static annotation is only allowed on public members. + @static private val baz = 2 + ^ +static-annot.scala:39: error: The @static annotation is not allowed on lazy members. + @static lazy val bam = 3 + ^ +static-annot.scala:14: error: Only members of top-level objects and their nested objects can be annotated with @static. + @static val blah = 2 + ^ +6 errors found
\ No newline at end of file diff --git a/test/files/neg/static-annot.scala b/test/files/neg/static-annot.scala new file mode 100644 index 0000000000..c6c626d42b --- /dev/null +++ b/test/files/neg/static-annot.scala @@ -0,0 +1,47 @@ + + +import annotation.static + + + +class StaticInClass { + @static val bar = 1 +} + + +class NestedObjectInClass { + object Nested { + @static val blah = 2 + } +} + + +object NestedObjectInObject { + object Nested { + @static val succeed = 3 + } +} + + +object Conflicting { + @static val bar = 1 +} + + +class Conflicting { + val bar = 45 +} + + +object PrivateProtectedLazy { + @static private val bar = 1 + @static private val baz = 2 + @static lazy val bam = 3 +} + + +class PrivateProtectedLazy { + println(PrivateProtectedLazy.bar) + println(PrivateProtectedLazy.baz) + println(PrivateProtectedLazy.bam) +} diff --git a/test/files/neg/t4069.check b/test/files/neg/t4069.check index 91bf882cec..08e937bdfe 100644 --- a/test/files/neg/t4069.check +++ b/test/files/neg/t4069.check @@ -12,5 +12,5 @@ t4069.scala:4: error: I encountered a '}' where I didn't expect one, maybe this ^ t4069.scala:10: error: '}' expected but eof found. } -^ + ^ 5 errors found diff --git a/test/files/neg/t4425.check b/test/files/neg/t4425.check index 0f2fe6f2d1..a6a1a1fad4 100644 --- a/test/files/neg/t4425.check +++ b/test/files/neg/t4425.check @@ -1,4 +1,5 @@ -t4425.scala:3: error: isInstanceOf cannot test if value types are references. +t4425.scala:3: error: error during expansion of this match (this is a scalac bug). +The underlying error was: value _1 is not a member of object Foo.X 42 match { case _ X _ => () } - ^ + ^ one error found diff --git a/test/files/neg/t4584.check b/test/files/neg/t4584.check index 060160d76a..419f5704b1 100644 --- a/test/files/neg/t4584.check +++ b/test/files/neg/t4584.check @@ -1,4 +1,7 @@ -t4584.scala:1: error: incomplete unicode escape +t4584.scala:1: error: error in unicode escape +class A { val /u2 + ^ +t4584.scala:1: error: illegal character '/uffff' class A { val /u2 ^ -one error found +two errors found diff --git a/test/files/neg/t5856.check b/test/files/neg/t5856.check new file mode 100644 index 0000000000..ac49d4b9ac --- /dev/null +++ b/test/files/neg/t5856.check @@ -0,0 +1,31 @@ +t5856.scala:10: error: invalid string interpolation: `$$', `$'ident or `$'BlockExpr expected + val s9 = s"$" + ^ +t5856.scala:10: error: unclosed string literal + val s9 = s"$" + ^ +t5856.scala:2: error: error in interpolated string: identifier or block expected + val s1 = s"$null" + ^ +t5856.scala:3: error: error in interpolated string: identifier or block expected + val s2 = s"$false" + ^ +t5856.scala:4: error: error in interpolated string: identifier or block expected + val s3 = s"$true" + ^ +t5856.scala:5: error: error in interpolated string: identifier or block expected + val s4 = s"$yield" + ^ +t5856.scala:6: error: error in interpolated string: identifier or block expected + val s5 = s"$return" + ^ +t5856.scala:7: error: error in interpolated string: identifier or block expected + val s6 = s"$new" + ^ +t5856.scala:8: error: error in interpolated string: identifier or block expected + val s7 = s"$s1 $null $super" + ^ +t5856.scala:9: error: error in interpolated string: identifier or block expected + val s8 = s"$super" + ^ +10 errors found diff --git a/test/files/neg/t5856.scala b/test/files/neg/t5856.scala new file mode 100644 index 0000000000..2ceee590af --- /dev/null +++ b/test/files/neg/t5856.scala @@ -0,0 +1,11 @@ +object Test { + val s1 = s"$null" + val s2 = s"$false" + val s3 = s"$true" + val s4 = s"$yield" + val s5 = s"$return" + val s6 = s"$new" + val s7 = s"$s1 $null $super" + val s8 = s"$super" + val s9 = s"$" +}
\ No newline at end of file diff --git a/test/files/neg/t5892.check b/test/files/neg/t5892.check new file mode 100644 index 0000000000..839bf9de23 --- /dev/null +++ b/test/files/neg/t5892.check @@ -0,0 +1,17 @@ +t5892.scala:5: error: type mismatch; + found : Boolean(false) + required: String +class C[@annot(false) X] { + ^ +t5892.scala:9: error: not found: value b2s +class D[@annot(b2s(false)) X] { + ^ +t5892.scala:13: error: type mismatch; + found : Boolean(false) + required: String +@annot(false) class E { + ^ +t5892.scala:17: error: not found: value b2s +@annot(b2s(false)) class F { + ^ +four errors found diff --git a/test/files/neg/t5892.scala b/test/files/neg/t5892.scala new file mode 100644 index 0000000000..5e3b2f313e --- /dev/null +++ b/test/files/neg/t5892.scala @@ -0,0 +1,25 @@ +import language.implicitConversions + +class annot(a: String) extends annotation.StaticAnnotation + +class C[@annot(false) X] { + implicit def b2s(b: Boolean): String = "" +} + +class D[@annot(b2s(false)) X] { + implicit def b2s(b: Boolean): String = "" +} + +@annot(false) class E { + implicit def b2s(b: Boolean): String = "" +} + +@annot(b2s(false)) class F { + implicit def b2s(b: Boolean): String = "" +} + +object T { + implicit def b2s(b: Boolean): String = "" + @annot(false) val x = 0 + @annot(b2s(false)) val y = 0 +} diff --git a/test/files/neg/unicode-unterminated-quote.check b/test/files/neg/unicode-unterminated-quote.check index fc5caa6d7e..5085505fb4 100644 --- a/test/files/neg/unicode-unterminated-quote.check +++ b/test/files/neg/unicode-unterminated-quote.check @@ -1,4 +1,7 @@ unicode-unterminated-quote.scala:2: error: unclosed string literal val x = /u0022 ^ -one error found +unicode-unterminated-quote.scala:2: error: '}' expected but eof found. + val x = /u0022 + ^ +two errors found |