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
When using 'with' to construct a record based on another record, in a specific set of circumstances the compiler fails with the following errors:
error FS0073: internal error: TryOptimizeRecordFieldGet: term argument out of range
error FS0193: internal error: Index was outside the bounds of the array.
The following toy application reproduces the error:
type FooBar =
{ xyz : string }
static let staticLet = 1
let doThing (foo : FooBar) =
let bar = { foo with xyz = foo.xyz }
let baz = { bar with xyz = bar.xyz }
printfn "%O" baz
doThing { xyz = "" }
Note that the following are required:
baz must use with based on another record type that also uses with based on another record type: if baz is changed to = { foo with... the code builds correctly.
The record type must contain a static let: if staticLet is removed then the code builds correctly.
The code must be in a function: if doThing is removed and replaced with let foo = { Field = "" } then the code builds correctly.
This error only happens when building with optimisations switched on.
Tested using the 9.0.101 SDK.
The text was updated successfully, but these errors were encountered:
When using 'with' to construct a record based on another record, in a specific set of circumstances the compiler fails with the following errors:
The following toy application reproduces the error:
Note that the following are required:
baz
must usewith
based on another record type that also useswith
based on another record type: ifbaz
is changed to= { foo with...
the code builds correctly.static let
: ifstaticLet
is removed then the code builds correctly.doThing
is removed and replaced withlet foo = { Field = "" }
then the code builds correctly.This error only happens when building with optimisations switched on.
Tested using the
9.0.101
SDK.The text was updated successfully, but these errors were encountered: