Skip to content

Conversation

@OlivierBlanvillain
Copy link
Contributor

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.

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.
@allanrenucci
Copy link
Contributor

This code snippet also causes a match error because of an untyped tree.

class Test[T](f: List[String] => T)

object o {
  implicit object a extends Test(_ map identity)
  implicit object b extends Test(_ map identity)
}

Not sure it is related

Copy link
Contributor

@odersky odersky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was a scenario where the error happened? Can it be avoided? If possible I'd like to keep the assert because it looks useful to flag error situations.

@OlivierBlanvillain
Copy link
Contributor Author

The test case included in the PR throws a match error on master (note that F is undefined)

case Thicket(ts) =>
this(x, ts)
case _ if ctx.mode.is(Mode.Interactive) =>
case _ =>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Proposal: replace with

case _ if ctx.errorsReported || ctx.mode.is(Mode.Interactive) =>

and adapt the comment to say that in interactive mode, errors might come from previous runs.

@OlivierBlanvillain OlivierBlanvillain merged commit 759daf2 into scala:master Feb 12, 2018
@allanrenucci allanrenucci deleted the fix-match-error-in-tree-accumulator branch February 12, 2018 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants