Repository navigation
Map fixed-width integer types and apply variable member defaults in constructors - #266
Merged
Merged
Conversation
…d Python generators short, ushort, uint, ulong, byte and sbyte had no mapping, so they were written verbatim and none of the five toolchains accepted them. A Widths exemplar holding each one as a member and a constructor parameter now goes through every compile test. Fixes #259. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QLW9twfnbvGihgS2DBD5HX
…er cannot deadlock the tests Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QLW9twfnbvGihgS2DBD5HX
…ared value in Rust, Go and C The Rust, Go and C constructors gathered starting values from field declarations only, so a variable declaration with an initial value that the constructor did not set was dropped: rustc refused the struct literal with E0063, and Go and C started the member at zero. Both member kinds are now gathered through one helper. Closes #262. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QLW9twfnbvGihgS2DBD5HX
|
This was referenced Oct 19, 2026
Closed
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.



Requested by Matt · project thread
Before: the C, C++, Rust and Go generators wrote
short,ushort,uint,ulong,byteandsbyteexactly as given. None of those compilers accept these names; Go acceptsbyteonly by coincidence. Python fell back toAnyfor them. Separately, a constructor that didn't set a member declared as aVariableDeclarationwith a starting value dropped that value. rustc refused the struct literal with E0063, and Go and C started the member at zero.After: each of the six types maps to its fixed-width counterpart in every target. A member declared as a variable now starts at its declared value in Rust, Go and C constructors, the same as one declared as a field.
Fixes #259. Closes #262.
How:
CompiledExemplar.Widths()type uses every width as both a member and a constructor parameter. It is compiled by gcc, g++, dotnet, go and rustc.StandardLanguageGenerator.InstanceDefaultscollects starting values from both kinds of member. Rust, Go and C use it for their constructors. New compile-and-run tests inConstructorFieldDefaultTestscover all three languages.ToolchainHarness.Runnow reads stderr while it reads stdout. Reading them one after the other deadlocked on Windows once rustc's warnings filled the pipe.The full suite passes locally: 1311 tests, none skipped.
https://claude.ai/code/session_01QLW9twfnbvGihgS2DBD5HX
Generated by Claude Code