Repository navigation
feat(rust): various codegen and runtime improvements - #4781
Merged
MangelMaxime merged 3 commits intoJul 15, 2026
Merged
Conversation
MangelMaxime
force-pushed
the
pr/2-rust-improvements
branch
from
July 15, 2026 16:24
9dfb673 to
68ab383
Compare
Contributor
Author
|
Let me know if you need any help rebasing these. I just don't want to do it at the same time as you, because of the "force". |
Member
|
Thank you for proposing. For this PR, it was easy enough as just dropping the commit. I am now working on reviewing the changes, adding tests if needed etc. Hopefully, the other issues will be as simple to rebase 🤞 |
MangelMaxime
added a commit
that referenced
this pull request
Jul 16, 2026
=== changelog === * Cast `bool` to integer types; support `**` via `.powf` * Add `Decimal.IsInteger/IsEvenInteger/IsOddInteger/IsCanonical` * Fix two-switch decision trees dispatching to the wrong target * Fix reference-typed match bindings panicking via `mem::zeroed` * Fix string and non-ident option pattern matches emitting invalid Rust `match` arms * Fix `Convert.ToXxx(bool)` * Fix `Char.ToUpper/ToLower` truncating multi-char case mappings * Fix `Random.nextDouble` panic message * Fix `Map.find/tryFind` panicking on reference-typed values === changelog === Co-authored-by: Mangel Maxime <me@mangelmaxime.fr>
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.
This is split from #4774 and is dependent on #4780 (so that should be merged first).
Copilot generated description:
This pull request significantly improves Fable's support for F# quotations, especially for statically typed targets like Rust. The changes ensure that quoted expressions preserve .NET member metadata, generate portable representations for values like null and unit, and improve compatibility and fidelity for pattern matching, options, lists, and type information. Several helpers and code paths are refactored to produce correct and target-agnostic quotation trees.
Quotations emission and representation improvements:
CapturingQuotationflag in theContext, ensuring that member calls are not replaced or inlined when capturing quotations. This preserves necessary metadata for downstream consumers like the QuotationEmitter. [1] [2] [3] [4]mkNullExpr) for instance-less calls, unit, null, option None, and empty lists, improving compatibility with statically typed targets such as Rust and Dart. [1] [2] [3]IfThenElseandLetexpressions, matching F#'s quotation semantics.Target-specific and cross-target compatibility:
mkCallin quotations, ensuring compatibility with Rust's stricter function arity and maintaining back-compatibility with other runtimes.General improvements and refactoring:
boolto integer types, matching Rust's native casting semantics.These changes together make Fable's quotation support more robust, portable, and faithful to F# semantics across all supported targets.
References:
[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]