diff options
author | Geoffrey Washburn <geoffrey.washburn@epfl.ch> | 2008-11-22 22:35:23 +0000 |
---|---|---|
committer | Geoffrey Washburn <geoffrey.washburn@epfl.ch> | 2008-11-22 22:35:23 +0000 |
commit | 21749978ee131a02b1a0cddd3d349f6548edaaa1 (patch) | |
tree | 4b712aaca226210bceebfdbac38d36c265e57e3d | |
parent | be91cd08be3590f6cdbb9356b4d093725d5e06ff (diff) | |
download | scala-21749978ee131a02b1a0cddd3d349f6548edaaa1.tar.gz scala-21749978ee131a02b1a0cddd3d349f6548edaaa1.tar.bz2 scala-21749978ee131a02b1a0cddd3d349f6548edaaa1.zip |
Fix for #1371.
-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 <: (_)] + |