Add total
to #let
-bindings where LHS is a variable
#3798
Merged
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.
This PR addresses an issue whereby the Booster reverts to the old Haskell backend when it encounters a rule written using
#let
bindings. The reason for this is that the de-sugared form of#let
is expressed in terms of an intermediate#lambda
function that is not marked as beingtotal
.To address the issue, this PR adds the
total
attribute to the desugared intermediate lambda function for let-bindings and anonymous functions when the left-hand side of the original binding is a variable.Points to consider when reviewing this PR:
Is the identification of when the LHS a variable correct in its handling of semantic casts and sorting? My presumption is that it is given that the "first child of#SemanticCastTo
KApply
" logic is replicated elsewhere.total
to#let
-bindings where LHS is a variable #3798 (comment)Fixes #3715