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

Typechecking for new records #1692

Merged
merged 10 commits into from
Apr 29, 2022
Merged

Typechecking for new records #1692

merged 10 commits into from
Apr 29, 2022

Conversation

konnov
Copy link
Collaborator

@konnov konnov commented Apr 28, 2022

Closes #1688. This PR integrates type checking of new records when --features=rows is enabled. As the four integration tests demonstrate, the new type checker reports type errors in examples that were problematic and counterintuitive with the old records.

Type checking for variants is not implemented in this PR. It is scheduled for a later one.

  • Tests added for any new code
  • Ran make fmt-fix (or had formatting run automatically on all files edited)
  • Documentation added for any new functionality
  • Entry added to UNRELEASED.md for any new functionality

Copy link
Collaborator

@bugarela bugarela left a comment

Choose a reason for hiding this comment

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

Looks good, the integration tests are awesome! Just a small question inline

}

test("invalid field string in record set construction") {
val invalid = "invalidName"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't get why this field name is invalid, can you help me understand?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point. I have added a comment. The test is checking that only ValEx(TlaStr(_)) can be passed, not NameEx(_).

@codecov-commenter
Copy link

codecov-commenter commented Apr 29, 2022

Codecov Report

Merging #1692 (da86045) into unstable (ce106fa) will increase coverage by 0.00%.
The diff coverage is 88.23%.

@@            Coverage Diff            @@
##           unstable    #1692   +/-   ##
=========================================
  Coverage     75.30%   75.31%           
=========================================
  Files           357      357           
  Lines         11534    11542    +8     
  Branches        619      624    +5     
=========================================
+ Hits           8686     8693    +7     
- Misses         2848     2849    +1     
Impacted Files Coverage Δ
.../tla/typecheck/passes/EtcTypeCheckerPassImpl.scala 0.00% <0.00%> (ø)
...rsyte/apalache/tla/typecheck/TypeCheckerTool.scala 92.30% <100.00%> (ø)
...forsyte/apalache/tla/typecheck/etc/ToEtcExpr.scala 94.77% <100.00%> (+0.09%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ce106fa...da86045. Read the comment docs.

@konnov konnov enabled auto-merge April 29, 2022 13:43
@konnov konnov merged commit 9faa00b into unstable Apr 29, 2022
@konnov konnov deleted the ik/records1688 branch April 29, 2022 14:13
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.

Extend the type checker to support new records
3 participants