Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FSI 4.7: expression is too large and/or complex to emit #7673

Closed
kevmal opened this issue Oct 1, 2019 · 5 comments
Closed

FSI 4.7: expression is too large and/or complex to emit #7673

kevmal opened this issue Oct 1, 2019 · 5 comments
Milestone

Comments

@kevmal
Copy link
Contributor

kevmal commented Oct 1, 2019

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
        }
@cartermp
Copy link
Contributor

cartermp commented Oct 1, 2019

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.

@TIHan
Copy link
Contributor

TIHan commented Oct 1, 2019

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.

@TIHan
Copy link
Contributor

TIHan commented Oct 2, 2019

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.

@larjo
Copy link

larjo commented Oct 16, 2019

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.

@cartermp
Copy link
Contributor

#7678 resolves this.

@cartermp cartermp modified the milestones: Backlog, 16.5 Jan 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants