You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Rust and Beam crash on explicit constructors with a base and then #5271
An explicit constructor that has a base call and a then block crashes on Rust and Beam. .NET prints 20 1 1.
let mutablethenCalls=0typeNBase=valId:intnew(id:int)={ Id = id *10}typeNChild=inherit NBase
valExtra:intnew(id:int)={inherit NBase(id); Extra =1}then thenCalls <- thenCalls +1letnc= NChild(2)
printfn "%d%d%d" nc.Id nc.Extra thenCalls
Rust: Fable crashes with The lists had different lengths, raised from makeRecord in Fable2Rust.fs.
Beam: it compiles, then crashes at runtime with badmap in fable_utils:field_get.
Removing the then block fixes both, including with fields written out of declaration order.
Reproduced with ./build.sh quicktest rust and ./build.sh quicktest beam on 7e12c10. #5235 doesn't change these results.
On Rust, the same crash also hides the Fable error that #5235 adds for new (...) as self = { inherit NBase(id); ... } then .... The build still fails, but with the crash instead of that message.
I haven't looked into the Beam side. For Rust, a review comment on #5235 points at the constructor handling in Fable2Rust.fs, which only inserts the base field for Sequential(baseCall, NewRecord(...)). I haven't confirmed that's the cause.
Activity