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

fix #493: pass method-wise type arguments to methods #495

Merged
merged 25 commits into from Jul 24, 2023
Merged

Conversation

yhara
Copy link
Collaborator

@yhara yhara commented Jul 8, 2023

This PR adds method-wise type arguments to llvm method functions so that it can be referred for type arguments (eg. Array<A>.new) or just like p A.

fix #493

  • Change arity of LLVM functions of methods that have method typarams
    • eg. for Enumerable#map<S>, add parameter S after normal parameters
  • Fix codegen of method calls to pass a class object for that S
    • To do this, add expression to get S to HirMethodCall
  • Fix gen_tvar_ref to get the value from llvm function parameter
    • TODO: what if we are in a lambda? →capture it like local variables

@yhara yhara force-pushed the pass-method-tyarg branch 2 times, most recently from ea49f25 to 2e3ecb9 Compare July 18, 2023 03:53
@yhara yhara force-pushed the pass-method-tyarg branch 2 times, most recently from 879f005 to 101c257 Compare July 21, 2023 05:00
@yhara yhara changed the title wip: fix #493 fix #493: pass method-wise type arguments to methods Jul 24, 2023
@yhara yhara marked this pull request as ready for review July 24, 2023 05:15
@yhara yhara merged commit 7d52b06 into main Jul 24, 2023
4 checks passed
@yhara yhara deleted the pass-method-tyarg branch July 24, 2023 05:16
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

Successfully merging this pull request may close these issues.

Wrong .class is set when using method typaram
1 participant