Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Fable.Cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

* [TypeScript] Fix static class members not re-declaring class-level type parameters, causing TypeScript type errors (fixes #3504)
* [JS/TS/Python/Beam] Fix `ResizeArray` (`System.Collections.Generic.List`) equality to use reference equality instead of structural equality (fixes #3718)
* [Beam] Fix `List.Cons` call replacement and test (by @ncave)
* [Beam/Dart/Python/TypeScript] Fix `Array.Equals` to use reference equality instead of structural equality (by @ncave)
Expand Down
1 change: 1 addition & 0 deletions src/Fable.Compiler/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

* [TypeScript] Fix static class members not re-declaring class-level type parameters, causing TypeScript type errors (fixes #3504)
* [JS/TS/Python/Beam] Fix `ResizeArray` (`System.Collections.Generic.List`) equality to use reference equality instead of structural equality (fixes #3718)
* [Beam] Fix `List.Cons` call replacement and test (by @ncave)
* [Beam/Dart/Python/TypeScript] Fix `Array.Equals` to use reference equality instead of structural equality (by @ncave)
Expand Down
9 changes: 8 additions & 1 deletion src/Fable.Transforms/Fable2Babel.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1404,7 +1404,14 @@ module Util =

let declaredTypeParams =
if isAttached then
info.GenericParameters
match kind with
| Attached(isStatic = true) ->
// Static methods cannot access class type params implicitly;
// they must re-declare them on the method itself.
entGenParams @ info.GenericParameters
| _ ->
// Instance methods inherit class type params; don't re-declare them.
info.GenericParameters
else
entGenParams @ info.GenericParameters
|> List.map (fun g -> Fable.GenericParam(g.Name, g.IsMeasure, g.Constraints))
Expand Down