fsprojects / FSharp.Compiler.PortaCode

The PortaCode F# code format and corresponding interpreter. Used by Fabulous and others.
Other
42 stars 11 forks source link

allow for generic trait calls #30

Open kevmal opened 3 years ago

kevmal commented 3 years ago

Current version fails with missing method exception on op --> (DiffSharp). This is because EvalTraitCallInvoke uses InvokeMember which does not support generic methods. As an alternative type parameters are matched, generic methods are created and Type.DefaultBinder.BindToMethod is then called directly.

This change alone fixes the diffsharp shape checking on -->. To add a test exit needed to be removed from ProcessCommandLine otherwise the failing test causes the test host process to exit. Furthermore since the test is not using a method in an external assembly, phase4 of EmitInterpretExpression needed to be updated to add generic parameters to the env prior to resolving parameter and return types.

dsyme commented 3 years ago

Cool thanks!

Any idea why CI was failing on Windows? I'm re-running it now