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

In the compiler, make default parameters instantiate values callee-side #1

Open
iconmaster5326 opened this issue Jan 18, 2018 · 0 comments

Comments

@iconmaster5326
Copy link
Member

Currently, the code is all set up to make default parameter values instantiate in the scope of the caller, which is frankly a bit silly.

To fix this:

  • Change the format of the CALL/CALLSTATIC instruction, so that the argument list may have nulls in it. A null indicates to the callee that it needs to give it a default value before running its code.
  • Change TyphonCompiler to just add nulls to the list instead of assigning to its internal variables. (It's only a TODO at this point, but remove the TODO.)
  • Check TyphonCompiler to make sure default parameters are being made into code blocks in that step.
  • In TnBox, before a function is executed, we can now run any default parameter code needed.

Minor things to do after this change include:

  • Change TyphonAnnotChecker so that parameters with the override annotation are allowed to have default values.
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

1 participant