Skip to content

Commit 759daf2

Browse files
Merge pull request #3487 from dotty-staging/fix-match-error-in-tree-accumulator
Fix MatchError: InfixOp on TreeAccumulator
2 parents 2729819 + bfd425f commit 759daf2

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

compiler/src/dotty/tools/dotc/ast/Trees.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1324,7 +1324,8 @@ object Trees {
13241324
this(this(x, arg), annot)
13251325
case Thicket(ts) =>
13261326
this(x, ts)
1327-
case _ if ctx.mode.is(Mode.Interactive) =>
1327+
case _ if ctx.reporter.errorsReported || ctx.mode.is(Mode.Interactive) =>
1328+
// In interactive mode, errors might come from previous runs.
13281329
// In case of errors it may be that typed trees point to untyped ones.
13291330
// The IDE can still traverse inside such trees, either in the run where errors
13301331
// are reported, or in subsequent ones.

tests/neg/i3487.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
object Test {
2+
type &:[H, T] = Int
3+
val a: F[Int] { type X = Int &: String } = ??? // error
4+
}

0 commit comments

Comments
 (0)