Skip to content

Commit 2179a40

Browse files
github-actions[bot]claudedbrattli
authored
[Repo Assist] [All] Fix unnecessary allocations in AST visitor for Import expressions (#4455)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: Dag Brattli <dag@brattli.net>
1 parent e07316a commit 2179a40

3 files changed

Lines changed: 3 additions & 9 deletions

File tree

src/Fable.Cli/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616

1717
### Fixed
1818

19+
* [All] Fix unnecessary object allocations during AST traversal when visiting `Import` expressions (by Repo Assist)
1920
* [Dart] Fix `Array.compareWith` comparing lengths before elements, producing wrong results for arrays with common prefixes (fixes #2961)
2021
* [Python] Fix unsafe option unwrapping in `DateTimeOffset.get_Offset` and regex replacements (by @dbrattli)
2122
* [All] Replace unsafe option `.Value` unwrapping with safe alternatives in Python/Replacements.fs and Rust/Fable2Rust.fs (code scanning alerts IONIDE-006)

src/Fable.Compiler/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616

1717
### Fixed
1818

19+
* [All] Fix unnecessary object allocations during AST traversal when visiting `Import` expressions (by Repo Assist)
1920
* [Dart] Fix `Array.compareWith` comparing lengths before elements, producing wrong results for arrays with common prefixes (fixes #2961)
2021
* [Python] Fix unsafe option unwrapping in `DateTimeOffset.get_Offset` and regex replacements (by @dbrattli)
2122
* [All] Replace unsafe option `.Value` unwrapping with safe alternatives in Python/Replacements.fs and Rust/Fable2Rust.fs (code scanning alerts IONIDE-006)

src/Fable.Transforms/Transforms.Util.fs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1571,15 +1571,7 @@ module AST =
15711571
| Unresolved _ -> e // Unresolved expressions must be matched explicitly
15721572
| IdentExpr _ -> e
15731573
| TypeCast(e, t) -> TypeCast(f e, t)
1574-
| Import(info, t, r) ->
1575-
Import(
1576-
{ info with
1577-
Selector = info.Selector
1578-
Path = info.Path
1579-
},
1580-
t,
1581-
r
1582-
)
1574+
| Import _ -> e // Import has no sub-expressions to visit
15831575
| Extended(kind, r) ->
15841576
match kind with
15851577
| Curry(e, arity) -> Extended(Curry(f e, arity), r)

0 commit comments

Comments
 (0)