Skip to content

Fix MatchError: InfixOp on TreeAccumulator #3487

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -1325,7 +1325,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
}