Conversation
In CallElim's createAsserts, use setCallSiteFileRange to make the call site the primary diagnostic location. The requires clause's original location is preserved as a related file range for richer diagnostics.
Ensures clause metadata is also preserved as a related file range, matching the pattern used in createAsserts and ProcedureInlining.
MikaelMayer
commented
Apr 2, 2026
Contributor
Author
MikaelMayer
left a comment
There was a problem hiding this comment.
Clean, focused PR. The approach of reusing setCallSiteFileRange (already established in ProcedureInlining) is the right call — it keeps the pattern consistent across transforms. The correctness proofs compiling without changes is a good sign that the metadata change is semantics-preserving. One minor comment on comment consistency between the two functions.
MikaelMayer
commented
Apr 3, 2026
…n-diag # Conflicts: # StrataTest/Languages/Python/expected_laurel/test_class_methods.expected # StrataTest/Languages/Python/expected_laurel/test_missing_models.expected # StrataTest/Languages/Python/expected_laurel/test_multi_function.expected # StrataTest/Languages/Python/expected_laurel/test_precondition_verification.expected
…n-diag # Conflicts: # StrataTest/Languages/Python/expected_laurel/test_class_methods.expected # StrataTest/Languages/Python/expected_laurel/test_class_with_methods.expected # StrataTest/Languages/Python/expected_laurel/test_function_def_calls.expected # StrataTest/Languages/Python/expected_laurel/test_multi_function.expected
After merging main, the type constraint preconditions from #577 changed diagnostic names from callElimAssert_requires_N to descriptive (funcName requires) Type constraint of paramName format.
tautschnig
approved these changes
Apr 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #531
Problem
During call elimination, the generated asserts for
requirespreconditions used only the call site metadata (md), discarding the requires clause's own metadata. This meant origin-based labels and the requires clause's file range were lost, producing generic diagnostic names likecallElimAssert_requires_0_4and no link back to the original requires clause location.Fix
In
createAssertsandcreateAssumes, usecheck.md.setCallSiteFileRange mdinstead ofmdalone. This:Testing
All existing tests pass. The correctness proofs (
CallElimCorrect) compile without changes. A SARIF output test verifies that related locations are emitted correctly.