diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-08-16 11:41:53 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-08-16 11:41:53 -0700 |
commit | 63bce12e94eb4480823627d6328f74befa421bbf (patch) | |
tree | 9d4f6b762467e9af15c1d886e7f37caad9064911 /test/files/neg | |
parent | 01f2c2ac45a15312bd45193fd6302b7b01de9db7 (diff) | |
parent | 417718b7f68cb3a5c596a96cd351709a1ca18a7b (diff) | |
download | scala-63bce12e94eb4480823627d6328f74befa421bbf.tar.gz scala-63bce12e94eb4480823627d6328f74befa421bbf.tar.bz2 scala-63bce12e94eb4480823627d6328f74befa421bbf.zip |
Merge pull request #2830 from densh/topic/stats-parsing-2
updated SI-7331, SI-6843, SI-7731, parser entry point refactoring, assertThrows utility function
Diffstat (limited to 'test/files/neg')
-rw-r--r-- | test/files/neg/quasiquotes-syntax-error-position.check | 32 | ||||
-rw-r--r-- | test/files/neg/quasiquotes-syntax-error-position.scala | 15 |
2 files changed, 47 insertions, 0 deletions
diff --git a/test/files/neg/quasiquotes-syntax-error-position.check b/test/files/neg/quasiquotes-syntax-error-position.check new file mode 100644 index 0000000000..3bd813b1bb --- /dev/null +++ b/test/files/neg/quasiquotes-syntax-error-position.check @@ -0,0 +1,32 @@ +quasiquotes-syntax-error-position.scala:5: error: '=' expected but identifier found. + q"def $a f" + ^ +quasiquotes-syntax-error-position.scala:6: error: illegal start of simple expression + q"$a(" + ^ +quasiquotes-syntax-error-position.scala:7: error: '}' expected but end of quote found. + q"class $t { def foo = $a" + ^ +quasiquotes-syntax-error-position.scala:8: error: '.' expected but splicee found. + q"import $t $t" + ^ +quasiquotes-syntax-error-position.scala:9: error: illegal start of definition + q"package p" + ^ +quasiquotes-syntax-error-position.scala:10: error: ';' expected but '@' found. + q"foo@$a" + ^ +quasiquotes-syntax-error-position.scala:11: error: case classes without a parameter list are not allowed; +use either case objects or case classes with an explicit `()' as a parameter list. + q"case class A" + ^ +quasiquotes-syntax-error-position.scala:12: error: identifier expected but ']' found. + tq"$t => $t $t]" + ^ +quasiquotes-syntax-error-position.scala:13: error: end of quote expected but 'case' found. + cq"pattern => body ; case pattern2 =>" + ^ +quasiquotes-syntax-error-position.scala:14: error: ')' expected but end of quote found. + pq"$a(bar" + ^ +10 errors found diff --git a/test/files/neg/quasiquotes-syntax-error-position.scala b/test/files/neg/quasiquotes-syntax-error-position.scala new file mode 100644 index 0000000000..b97af52cfc --- /dev/null +++ b/test/files/neg/quasiquotes-syntax-error-position.scala @@ -0,0 +1,15 @@ +import scala.reflect.runtime.universe._ +object test extends App { + val a = TermName("a") + val t = TypeName("t") + q"def $a f" + q"$a(" + q"class $t { def foo = $a" + q"import $t $t" + q"package p" + q"foo@$a" + q"case class A" + tq"$t => $t $t]" + cq"pattern => body ; case pattern2 =>" + pq"$a(bar" +}
\ No newline at end of file |