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

Reset errors after validateAndAnnotate instead #1173

Merged
merged 3 commits into from
Jun 10, 2020

Conversation

openorclose
Copy link
Contributor

@openorclose openorclose commented May 27, 2020

Evaluator: Reset errors after validateAndAnnotate instead

Summary: Fixes issue #1174.

Description

Type-validation and annotation, or evaluation of a Source program, can both produce errors. This results in duplicate errors for certain Source programs when the errors from the evaluation are not preserved correctly.

image

To fix this, we specifically preserve only the errors (in red below) from evaluating the Source program, and use it to override the errors from type-validation and annotation. Any hints (in gray below) generated by type-validation and annotation are still preserved.

image

Changelog

  • Reset errors after validating and annotating Source program

Verification instructions

  1. Attempt to evaluate this program in the Playground editor
    const y = x;
    y = 2;
  2. Evaluation should result in only one error and one hint as shown in the second screenshot above

Last updated 10 Jun 2020, 1:00AM

@coveralls
Copy link

coveralls commented May 27, 2020

Pull Request Test Coverage Report for Build 5333

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 34.031%

Totals Coverage Status
Change from base Build 5330: 0.0%
Covered Lines: 1698
Relevant Lines: 4621

💛 - Coveralls

Copy link
Contributor

@Aulud Aulud left a comment

Choose a reason for hiding this comment

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

Nice 👍 - this fixes the issue; will clean up the PR and test it more thoroughly before getting one of the team members to review it.

@Aulud Aulud changed the base branch from sa_2021 to sa_2021_refactor June 9, 2020 15:41
validateAndAnnotate can also produce errors,
causing duplicate errors.
Copy link
Contributor

@Aulud Aulud left a comment

Choose a reason for hiding this comment

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

Fix works without introducing other errors when manually tested.

@angelsl angelsl merged commit fca2fbc into sa_2021_refactor Jun 10, 2020
@angelsl angelsl deleted the duplicate_errors branch June 10, 2020 15:20
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.

4 participants