The following has never caused issues but with "F# Interactive version 10.6.0.0 for F# 4.7" it gives a
error FS0073: internal error: Expression is too large and/or complex to emit.
The actual record is longer I just deleted fields to reduce the example length:
type Row =
{
``PRECID`` : string
``PFIRM`` : string
``POFFIC`` : string
``PACCT`` : string
``PATYPE`` : string
``PCUSIP`` : string
``PCTYM`` : string
``PSBCUS`` : string
``PSTYPE`` : string
``PSUBTY`` : string
``PSTYP2`` : string
``PSTRIK`` : string
``PEXPDT`` : string
``PTDATE`` : string
``PTPRIC`` : string
``PBS`` : string
``PSPRED`` : string
``PACNTY`` : string
``PRR`` : string
``PQTY`` : string
``PSDSC1`` : string
``PSDSC2`` : string
``PMKVAL`` : string
``PYSTMV`` : string
``PMULT`` : string
``PSDATE`` : string
``PDELTA`` : string
``PLTDAT`` : string
``PPCNTY`` : string
``PEXCH`` : string
``PFC`` : string
``PTYPE`` : string
``PSYMBL`` : string
``PPTYPE`` : string
``PSUBEX`` : string
``PMATDT`` : string
``PPRTPR`` : string
``PBASIS`` : string
``PCLOSE`` : string
``PPRCDT`` : string
``PPRTCP`` : string
``PUNDCP`` : string
``PPRTUC`` : string
``PPRVCP`` : string
``PCURSY`` : string
``PCURCD`` : string
``PCMNT1`` : string
``PCMNT2`` : string
``PCMNT3`` : string
``PRTHT`` : string
``POC`` : string
``PGIVIO`` : string
``PGIVF#`` : string
``PCARD`` : string
``PCOMM`` : string
``PFEE1`` : string
}
cc @TIHan
This could be related to stack overflow bugs we resolved in F# 4.7 where massive records would cause the compiler to stack overflow on .NET Core. This may have worked on FSI since it uses .NET Framework which didn't have that issue.
Yes, this is related. I already have a fix for it for a similar issue and this one might well be the same issue. Will make a PR today.
Seems my fix wasn't enough to handle more cases since I was able to spend a bit more time on it. I made a PR regardless though.
@kevmal , if you want this to work as is, you can put the [<NoEquality;NoComparison>] attribute on the record. This will prevent the equality + comparison methods that cause the overflows to not be generated. That is the current workaround until we figure out what we will do to resolve it.
I have an anonymous record with 48 fields that loads in fsi.exe but fails with Error FS0073 in fsiAnyCpu.exe.
With 47 fields it loads fine in both fsi and fsiAnyCpu.
Here is a gist: https://gist.github.com/larjo/d89b2a9184b151773de3117fa21f97fd
I am using the fsi and fsiCpuAny from the latest build tools, 16.3.5.
If I declare the anonymous record as a struct, it actually works in fsiAnyCpu. So that is a possible workaround.
Most helpful comment
7678 resolves this.