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.
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.