Repository navigation
Say a value is null on the right of '&&' or '||', in '?:' and in 'while' - #337
Merged
Merged
Conversation
…le', fixes #325 Co-authored-by: DicyAgent <354226518+DicyAgent@users.noreply.github.com>
Collaborator
Author
|
Pushed 71489ce. |
Collaborator
Author
|
Pushed a3bfbf0: finds the null test in any operand of a '&&' or '||' condition (fixes gap 1), with the pins for the compound shapes in tests/null_branch_operand_errors.ens and selfhost/sema/tests/phases/bodies/nullguidance_test.ens (gap 2). Also changed the advice for a compound test in an 'if' or '?:': the else branch can still be null there, so it now says to write the test the other way round, which compiles. |
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.
Closes #325
The null-branch message from #158 now covers the right side of '&&' and '||', the values of '?:', and the body of a 'while'. Each says the value is null there, names the test that proves it, and points at where the read works. The 'if' branch wording is unchanged.
Probes: the three issue shapes plus the negated and null-on-left forms print the new text; each offered fix compiles.