Skip to content
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

Fix #3383: Don't fail on unreported errors #3734

Merged
merged 2 commits into from
Jan 3, 2018

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Jan 2, 2018

#3383 shows that there are valid cases where an error type is assigned to a tree
before the error is reported. The error will then be reported later in adapt.

scala#3383 shows that there are valid cases where an error type is assigned to a tree
before the error is reported. The error will then be reported later in `adapt`.
assert(ctx.mode.is(Mode.Interactive) || ctx.reporter.errorsReported)
else if (Config.checkTreesConsistent)
if (Config.checkUnreportedErrors)
if (tpe.isInstanceOf[ErrorType]) assert(ctx.reporter.errorsReported)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why drop the ctx.mode.is(Mode.Interactive)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No need I think. Since Config.checkUnreportedErrors is by default false, we don't need the additional test. If someone turns Config.checkUnreportedErrors on for the IDE I assume they know what they are doing.

else if (Config.checkTreesConsistent)
if (Config.checkUnreportedErrors)
if (tpe.isInstanceOf[ErrorType]) assert(ctx.reporter.errorsReported)
if (Config.checkTreesConsistent)
Copy link
Contributor

Choose a reason for hiding this comment

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

Now, if tpe.isInstanceOf[ErrorType] is true we would go into this branch. Is this intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. No, we need to fix that.

@nicolasstucki nicolasstucki merged commit 22c0f91 into scala:master Jan 3, 2018
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.

None yet

2 participants