-
Notifications
You must be signed in to change notification settings - Fork 69
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
core: Implement RangeVarConstraint #2704
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## emilien/irdl-split #2704 +/- ##
======================================================
+ Coverage 89.79% 89.81% +0.01%
======================================================
Files 379 379
Lines 48104 48185 +81
Branches 7370 7382 +12
======================================================
+ Hits 43197 43278 +81
- Misses 3757 3760 +3
+ Partials 1150 1147 -3 ☔ View full report in Codecov by Sentry. |
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.
Some docstrings and comments would be highly welcome! I have no clue what's going on here. I don't even know what a range constraint is.
Added docstrings, and tried to clarify the variable ones! RangeVarConstraint works just like VarConstraint, but on ranges (sequences of attributes, as opposed to single attributes) |
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.
Very nice!
index_operand = TestSSAValue(IndexType()) | ||
|
||
op = ConstraintRangeVarOp.create(operands=[index_operand], result_types=[i32]) | ||
with pytest.raises(DiagnosticException): |
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.
Can you match for part of the exception message?
So we are sure that we are failing because of the range constraint, not something else.
op = ConstraintRangeVarOp.create( | ||
operands=[test_operand], result_types=[TestType("foo")] | ||
) | ||
with pytest.raises(DiagnosticException): |
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.
Same here with the exception message
This reverts commit 197ede8.
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
This is similar to VarConstraint, but constraining ranges to match instead.