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

FParsec throws MissingMethodException in certain scenarios #47

Closed
abelbraaksma opened this issue Oct 11, 2019 · 2 comments
Closed

FParsec throws MissingMethodException in certain scenarios #47

abelbraaksma opened this issue Oct 11, 2019 · 2 comments

Comments

@abelbraaksma
Copy link

abelbraaksma commented Oct 11, 2019

This has been reported here on StackOverflow, and here for F#.

Bottom line is that FParsec is not up-to-date with the more recent versions of FSharp.Core and a bug related to FSharpFunc lead to the latter raising MissingMethodException, even when the method is actually available. Using bindingRedirect does not solve the issue.

If your project uses FSharp.Core 4.3.4 or later you can run into this issue, however it doesn't always throw. It is difficult to create a minimal repro, but the resolution is simple: compile FParsec against a newer version of FSharp.Core and it works.

I propose that new binaries be created for the NuGet downloads and that the project be updated to use a new(er) version of FSharp.Core from NuGet, as this will solve this hard to trace error. It wouldn't be a bad thing to do since the last version is from 2017.

The actual error I see is the following, but the actual error one sees can be of a different generic instantiation:

----> System.MissingMethodException : Method not found: 'Microsoft.FSharp.Core.FSharpFunc`2<FParsec.CharStream`1<!!1>,FParsec.Reply`1<!!0>> FParsec.Primitives.op_DotGreaterGreater(Microsoft.FSharp.Core.FSharpFunc`2<FParsec.CharStream`1<!!1>,FParsec.Reply`1<!!0>>, Microsoft.FSharp.Core.FSharpFunc`2<FParsec.CharStream`1<!!1>,FParsec.Reply`1<!!2>>)'.

@mbenoni7
Copy link

I received a very similar error using Framework 4.7.2 and FSharp.Core 4.6.2:

System.MissingMethodException: 'Method not found: 'Microsoft.FSharp.Core.FSharpFunc`2<FParsec.CharStream`1<!2>,FParsec.Reply`1<!0>> FParsec.OperatorPrecedenceParser`3.get_ExpressionParser()'.'

Can confirm that rebuilding FParsec with FSharp.Core 4.6.2 fixed the issue. Thanks for the heads up.

@stephan-tolksdorf
Copy link
Owner

I've pushed a release candidate package for version 1.1.0. Could you maybe try it out and see if you still run into this issue? (I'm open to increasing the version of the FSharp.Core dependency if the issue persists.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants