Skip to content

Commit 08774c8

Browse files
Fix MatchError: InfixOp on TreeAccumulator
In case of errors it may be that typed trees point to untyped ones. I think it makes sense to avoid the MatchError in that case, not only in Interative mode.
1 parent 40011e2 commit 08774c8

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1325,7 +1325,7 @@ object Trees {
13251325
this(this(x, arg), annot)
13261326
case Thicket(ts) =>
13271327
this(x, ts)
1328-
case _ if ctx.mode.is(Mode.Interactive) =>
1328+
case _ =>
13291329
// In case of errors it may be that typed trees point to untyped ones.
13301330
// The IDE can still traverse inside such trees, either in the run where errors
13311331
// 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)