diff options
-rw-r--r-- | src/compiler/scala/tools/nsc/ast/parser/Parsers.scala | 4 | ||||
-rw-r--r-- | test/files/neg/t1371.check | 4 | ||||
-rw-r--r-- | test/files/neg/t1371.scala | 2 |
3 files changed, 7 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala index b7032f8048..94f6039737 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala @@ -2503,7 +2503,7 @@ trait Parsers extends NewScanners with MarkupParsers { /** CompilationUnit ::= [package QualId semi] TopStatSeq */ - def compilationUnit(): Tree = { + def compilationUnit(): Tree = checkNoEscapingPlaceholders { var pos = inCurrentPos; { val ts = new ListBuffer[Tree] @@ -2528,8 +2528,6 @@ trait Parsers extends NewScanners with MarkupParsers { } else { ts ++= topStatSeq() } - assert(placeholderParams.isEmpty) - assert(placeholderTypes.isEmpty) val stats = ts.toList val usePos = if (stats.isEmpty || stats.head.pos == NoPosition) i2p(pos) else stats.head.pos atPos(usePos) { stats match { diff --git a/test/files/neg/t1371.check b/test/files/neg/t1371.check new file mode 100644 index 0000000000..f2e9ffebe8 --- /dev/null +++ b/test/files/neg/t1371.check @@ -0,0 +1,4 @@ +t1371.scala:1: error: unbound wildcard type +trait A[T <: (_)] + ^ +one error found diff --git a/test/files/neg/t1371.scala b/test/files/neg/t1371.scala new file mode 100644 index 0000000000..4ad84a9d5c --- /dev/null +++ b/test/files/neg/t1371.scala @@ -0,0 +1,2 @@ +trait A[T <: (_)] + |