diff options
author | Martin Odersky <odersky@gmail.com> | 2016-05-27 23:25:26 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-07-11 13:34:59 +0200 |
commit | 178e90e441481364f19163a9dad624a4d859fb1b (patch) | |
tree | e459e09d425031af841db994941f51f0334e3adf /src/dotty/tools/dotc/parsing/Parsers.scala | |
parent | 08a0ea65b911726b327a9caf36e0e48acb5c5e93 (diff) | |
download | dotty-178e90e441481364f19163a9dad624a4d859fb1b.tar.gz dotty-178e90e441481364f19163a9dad624a4d859fb1b.tar.bz2 dotty-178e90e441481364f19163a9dad624a4d859fb1b.zip |
Remove special case in parser
There was a special case that triggered a parse error in this course
def lift[T <: Type](tp: T): (RecType => T) = arg match {
case rt0: RecType => tp.subst(rt0, _).asInstanceOf[T]
case _ => (x => tp)
}
The problem was that the rhs of the first case became a Function node, which
caused a premature return from the case clause sequence. I could not determine
anymore what the purpose of the removed case in the parser was; all tests compile
without it.
Diffstat (limited to 'src/dotty/tools/dotc/parsing/Parsers.scala')
-rw-r--r-- | src/dotty/tools/dotc/parsing/Parsers.scala | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/dotty/tools/dotc/parsing/Parsers.scala b/src/dotty/tools/dotc/parsing/Parsers.scala index 0cc392bad..51b681c0e 100644 --- a/src/dotty/tools/dotc/parsing/Parsers.scala +++ b/src/dotty/tools/dotc/parsing/Parsers.scala @@ -2138,17 +2138,10 @@ object Parsers { var exitOnError = false while (!isStatSeqEnd && in.token != CASE && !exitOnError) { setLastStatOffset() - if (in.token == IMPORT) { + if (in.token == IMPORT) stats ++= importClause() - } - else if (isExprIntro) { - val t = expr(Location.InBlock) - stats += t - t match { - case _: Function => return stats.toList - case _ => - } - } + else if (isExprIntro) + stats += expr(Location.InBlock) else if (isDefIntro(localModifierTokens)) if (in.token == IMPLICIT) { val start = in.skipToken() |