Repository navigation
fix(beam): disambiguate property accessors from ordinary methods - #5049
Merged
Merged
Conversation
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.
BEAM snake_case sanitization merges a property accessor such as
set_StatusCodewith the ordinary methodSetStatusCode. Their argument types also produce the same overload hash, so Fable 5.20 rejects this valid API and earlier output can retain only one body.Give BEAM property accessors an
_accessorsuffix after the overload hash in the upstream member-name constructor. Declarations and local, cross-file, and referenced-library calls derive the same name from member metadata. Align CLI event property/getter symbols and theStringBuilder.Lengthruntime replacement with that naming contract. Ordinary method names remain unchanged, and genuine name/arity collisions still fail compilation.Add seven behavioral regressions with different property and ordinary method bodies, including a referenced-library caller and a method reference. The saved reproduction now returns
201through the property and202through the method; generated Erlang contains distinct definitions and correctly resolved calls.Validation:
./build.sh test beam --force-fable-library: 2,729 .NET tests and 2,781 BEAM tests passed, plus entry-point and collision diagnostic fixtures.dotnet fantomas . --checkand a final check of the changed F# source files passed.AnalyzeFSharpProjectcompleted for the shared and BEAM transform projects; existing findings remain outside the changed code.git diff --checkpassed.Generated getter/setter names change. Rebuild generated libraries, the BEAM runtime, and callers together, and update native Erlang calls to those accessors. The public F# APIs are unchanged. Document this compatibility implication and clarify the remaining Identifiers limitation in
FABLE-BEAM.md.