[Beam] Fix double-quoted atoms for uppercase CompiledName DU cases#4388
Merged
[Beam] Fix double-quoted atoms for uppercase CompiledName DU cases#4388
Conversation
quoteErlangAtom was called in Fable2Beam.fs before storing atom names into the Atom AST node, but the printer also calls quoteErlangAtom when rendering AtomLit. This caused uppercase atoms like EXIT to be emitted as ''EXIT'' (double single-quotes) instead of 'EXIT'. Fix: remove quoteErlangAtom calls from Fable2Beam.fs so quoting only happens once at print time in ErlangPrinter.fs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
resolveImportModuleName compared derived module names (e.g., "types") to decide if an import is local. When two projects both have Types.fs, the import was incorrectly treated as a local call, producing infinite self-recursion (e.g., empty_handle() -> empty_handle()). Fix: compare resolved absolute file paths instead of module names. Co-Authored-By: Claude Opus 4.6 <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
[<CompiledName("EXIT")>](or any uppercase name) is used on a DU case.quoteErlangAtomwas called both inFable2Beam.fs(when building the AST) and inErlangPrinter.fs(when rendering), producing''EXIT''instead of'EXIT'.resolveImportModuleNamecompared derived module names (e.g.,"types") to decide if an import is local. When two projects both haveTypes.fs, the import was incorrectly treated as a local call (e.g.,empty_handle() -> empty_handle()). Fixed by comparing resolved absolute file paths instead of module names.Erlang.receivewith uppercaseCompiledNameatom tag.Test plan
CompiledNamelikecustom_tagstill works)test Erlang receive with uppercase CompiledName atom tagpasses.erlfiles use'EXIT'(single-quoted) not''EXIT''🤖 Generated with Claude Code