Skip to content

allow for generic trait calls - #30

Open
kevmal wants to merge 2 commits into
fsprojects:masterfrom
kevmal:genmethod
Open

allow for generic trait calls#30
kevmal wants to merge 2 commits into
fsprojects:masterfrom
kevmal:genmethod

Conversation

@kevmal

Copy link
Copy Markdown

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.

- avoid InvokeMember which does not support generic methods
- remove exit call from ProcessCommandLine to allow for testing
- Define generic parameters prior to resolving types on method emit
@dsyme

Copy link
Copy Markdown
Contributor

Cool thanks!

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

@dsymedsyme closed this Mar 8, 2026
@dsymedsyme reopened this Mar 8, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@kevmal@dsyme