diff --git a/src/compiler/scala/tools/reflect/quasiquotes/Parsers.scala b/src/compiler/scala/tools/reflect/quasiquotes/Parsers.scala index 3b93a8933d4a..e687e8106978 100644 --- a/src/compiler/scala/tools/reflect/quasiquotes/Parsers.scala +++ b/src/compiler/scala/tools/reflect/quasiquotes/Parsers.scala @@ -22,7 +22,8 @@ trait Parsers { self: Quasiquotes => def parse(code: String): Tree = { try { val file = new BatchSourceFile(nme.QUASIQUOTE_FILE, code) - new QuasiquoteParser(file).parseRule(entryPoint) + val parser = new QuasiquoteParser(file) + parser.checkNoEscapingPlaceholders { parser.parseRule(entryPoint) } } catch { case mi: MalformedInput => c.abort(correspondingPosition(mi.offset), mi.msg) } diff --git a/test/files/scalacheck/quasiquotes/ErrorProps.scala b/test/files/scalacheck/quasiquotes/ErrorProps.scala index d61119d98f48..3d9b27de7771 100644 --- a/test/files/scalacheck/quasiquotes/ErrorProps.scala +++ b/test/files/scalacheck/quasiquotes/ErrorProps.scala @@ -160,6 +160,18 @@ object ErrorProps extends QuasiquoteProperties("errors") { q"$n" """) + property("SI-8211: check unbound placeholder paremeters") = fails( + "unbound placeholder parameter", + """ + q"_" + """) + + property("SI-8211: check unbound wildcard types") = fails( + "unbound wildcard type", + """ + tq"_" + """) + // // Make sure a nice error is reported in this case // { import Flag._; val mods = NoMods; q"lazy $mods val x: Int" } }