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

Function scope lifting and nested functions #150

Open
counc009 opened this issue May 19, 2019 · 1 comment
Open

Function scope lifting and nested functions #150

counc009 opened this issue May 19, 2019 · 1 comment
Labels

Comments

@counc009
Copy link
Contributor

In our implementation of function scope lifting (see #149), we currently inject definitions into the second outermost scope of the environment. In general, this is correct, but when we have nested functions this is incorrect, as the declarations will be lifted to the outermost scope of the nested function, but will be placed into the environment of the outermost scope of the outer function.
Currently, I don't believe there to be a solution to this, it would likely require modifying how environments are designed in a manner that would allow us to identify what scope is the inner-most function scope.

@counc009 counc009 added the bug label May 19, 2019
@krame505
Copy link
Member

Just to clarify, I think we are currently injecting declarations into the innermost function scope; the issue is that the environment being provided to the Decls being lifted only contains declarations from the outermost function scope and above.

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

No branches or pull requests

2 participants