Skip to content

Commit

Permalink
Merge pull request scala#3487 from dotty-staging/fix-match-error-in-t…
Browse files Browse the repository at this point in the history
…ree-accumulator

Fix MatchError: InfixOp on TreeAccumulator
  • Loading branch information
OlivierBlanvillain authored Feb 12, 2018
2 parents 2729819 + bfd425f commit 759daf2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion compiler/src/dotty/tools/dotc/ast/Trees.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1324,7 +1324,8 @@ object Trees {
this(this(x, arg), annot)
case Thicket(ts) =>
this(x, ts)
case _ if ctx.mode.is(Mode.Interactive) =>
case _ if ctx.reporter.errorsReported || ctx.mode.is(Mode.Interactive) =>
// In interactive mode, errors might come from previous runs.
// In case of errors it may be that typed trees point to untyped ones.
// The IDE can still traverse inside such trees, either in the run where errors
// are reported, or in subsequent ones.
Expand Down
4 changes: 4 additions & 0 deletions tests/neg/i3487.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
object Test {
type &:[H, T] = Int
val a: F[Int] { type X = Int &: String } = ??? // error
}

0 comments on commit 759daf2

Please sign in to comment.