-
-
Notifications
You must be signed in to change notification settings - Fork 40
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
Type compatibility error message, when reading from .cfg #2757
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2757 +/- ##
==========================================
- Coverage 78.85% 78.83% -0.02%
==========================================
Files 464 464
Lines 15878 15882 +4
Branches 2545 2589 +44
==========================================
+ Hits 12520 12521 +1
- Misses 3358 3361 +3
... and 2 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
afaiu from #2750 (comment), we still don't parse uninterpreted type literals from TLC configs, so I'm not sure this actually "closes" the issue. We should check with @konnov what the expected outcome of that issue is, or split it into subtasks, where one is preventing the exception (addressed here), and the other is support for the provided spec. Also, please add a PR description. |
I don't think we'll ever support ULs in .cfg, mainly because .cfg is not Apalache native. As for supporting the spec, given the cfg as it is provided, the cleanest solution is to replace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I just left one comment. Thanks for fixing this!
@@ -64,11 +64,11 @@ object ConfigModelValue { | |||
* the name of a model value | |||
*/ | |||
case class ConfigModelValue(name: String) extends ConfigConstExpr { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the difference between ConfigModelValue
and ConfigStrValue
now? It looks like ConfigStrValue
handles model values too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ConfigModelValue
is what you get when TLC model values are parsed (e.g. a
and b
in Producers = {a,b}
).
ConfigStrValue
is what you get when a "
-value is parsed (e.g. "abc"
or "1_OF_X"
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
Amazing that it now works with uninterpreted types
Co-authored-by: Thomas Pani <[email protected]>
make fmt-fix
(or had formatting run automatically on all files edited)./unreleased/
for any new functionalityThis PR adds an additional type validation check to any CONSTANT overwritten from a .cfg file. Since the typechecking pass precedes the configuration pass, it was otherwise possible to introduce type-inconsistencies, by overwriting a constant declared with type
A
with a value of typeB
, which would only fail at the cell-introduction level, with cryptic error messages.72aaea0 adds support for literals of uninterpreted types within .cfg files (+ tests and some cleanup to use the typed builder smoothly)
closes #2750