diff options
author | Adriaan Moors <adriaan.moors@epfl.ch> | 2010-07-08 15:58:52 +0000 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@epfl.ch> | 2010-07-08 15:58:52 +0000 |
commit | 3c85f135693904cc0f433406c88842aa79e0140e (patch) | |
tree | d144f62baa905b2bf09cb361f2f3a0652a27a107 | |
parent | d7814a235963f40f4de1bf49efd4b22a8b0da5db (diff) | |
download | scala-3c85f135693904cc0f433406c88842aa79e0140e.tar.gz scala-3c85f135693904cc0f433406c88842aa79e0140e.tar.bz2 scala-3c85f135693904cc0f433406c88842aa79e0140e.zip |
closes #3247: syntax error regarding context bo...
closes #3247: syntax error regarding context bounds generalized to
include view bounds as we cannot easily be more specific no review
-rw-r--r-- | src/compiler/scala/tools/nsc/ast/parser/Parsers.scala | 4 | ||||
-rw-r--r-- | test/files/neg/bug882.check | 2 |
2 files changed, 3 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 f72e45bd99..7a28fd0538 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala @@ -1823,7 +1823,7 @@ self => if (in.token != RPAREN) { if (in.token == IMPLICIT) { if (!contextBounds.isEmpty) - syntaxError("cannot have both implicit parameters and context bounds `: ...' on type parameters", false) + syntaxError("cannot have both implicit parameters and context bounds `: ...' or view bounds `<% ...' on type parameters", false) in.nextToken() implicitmod = Flags.IMPLICIT } @@ -2331,7 +2331,7 @@ self => classContextBounds = contextBoundBuf.toList val tstart = (in.offset::classContextBounds.map(_.pos.startOrPoint)).min if (!classContextBounds.isEmpty && mods.hasFlag(Flags.TRAIT)) { - syntaxError("traits cannot have type parameters with context bounds `: ...'", false) + syntaxError("traits cannot have type parameters with context bounds `: ...' nor view bounds `<% ...'", false) classContextBounds = List() } val constrAnnots = annotations(false, true) diff --git a/test/files/neg/bug882.check b/test/files/neg/bug882.check index 8f47fefd9b..4e3e6d0860 100644 --- a/test/files/neg/bug882.check +++ b/test/files/neg/bug882.check @@ -1,4 +1,4 @@ -bug882.scala:2: error: traits cannot have type parameters with context bounds `: ...' +bug882.scala:2: error: traits cannot have type parameters with context bounds `: ...' nor view bounds `<% ...' trait SortedSet[A <% Ordered[A]] { ^ one error found |