fable-compiler / Fable

F# to JavaScript, TypeScript, Python, Rust and Dart Compiler
http://fable.io/
MIT License
2.93k stars 301 forks source link

static let and members on records cause invalid constructor generation #3923

Open joprice opened 1 month ago

joprice commented 1 month ago

Description

When a record is augmented with an static member or a static let, extra constructor parameters are generated for each, but the constructor call does not provide these parameters, resulting in the constructor arguments arbitrarily being assigned to slots intended for static parameters.

Repro code

Please provide the F# code to reproduce the problem or a link to the [REPL](https://fable.io/repl/). Ideally, it should be possible to easily turn this code into a unit test.

Expected and actual results

Static members on records should not break record constructor call sites.

Related information

davedawkins commented 1 month ago

I saw this too, thank you for logging!!