Print bool as the language's own literals: true/false - #19
Merged
Conversation
Settles the open question from the emitter PR: print(bool) and string(bool) now produce "true"/"false" — Arith's literal spellings — instead of .NET's "True"/"False", which matched neither the language nor the case-insensitive lowercase input accepted by typed main parameters. LANGUAGE_SPEC sections 7 and 10.1 state the rule, and print is defined as printing the string(value) conversion. The lowering replaces Boolean.ToString with a two-arm ldstr branch in the shared convert-to-string helper (the temp local is no longer needed for bool); e2e expectations updated across the suite. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Summary
Settles the open question tracked since #12:
print(true)andstring(true)now producetrue/false— Arith's own literal spellings — instead of .NET'sTrue/False, which matched neither the language's syntax nor the (case-insensitive, canonically lowercase) input accepted by typedmainparameters.string(flag) == "true"and argument round-trips now behave intuitively.boolconverts to"true"or"false"; §10.1 now definesprintas printing thestring(value)conversion, with the bool rule called out.Boolean.ToString()instance call (and its temp local) with a two-armldstrbranch — three instructions, using the branch machinery from Add control flow: if/while/for, comparisons, logical ops, definite return #14. The now-unusedBoolean::ToStringMemberRef is gone.NaNfloat formatting is unchanged.dotnet test: 405 passed / 1 skipped.🤖 Generated with Claude Code