You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calling CompilerControl.parseTree can return a typechecked tree, which is problematic if what you wanted was just a parsed tree.
It happens because the current implementation tries to memorize the tree. An easy fix is just to re-create the parse tree every time. Tests for this should check that:
You get a new parse tree every time you ask for one
A parse tree should never contain any symbols or types [1]
If you ask for a parse tree and then someone else asks for a typed tree it shouldn't change the parse tree you originally asked for, i.e. property
2 still holds.
I have a fix for this but I need to port my tests from the IDE to the compiler before I can have a pull request ready.
[1] There is an exception to this though. Some of the nodes that
the compiler generates will actually contain symbols. I've
chosen to just ignore these special cases for now.
The text was updated successfully, but these errors were encountered:
Calling
CompilerControl.parseTree
can return a typechecked tree, which is problematic if what you wanted was just a parsed tree.It happens because the current implementation tries to memorize the tree. An easy fix is just to re-create the parse tree every time. Tests for this should check that:
2 still holds.
I've discussed this with the IDE team and provided a fix in their project for now but this is something that should be fixed in the compiler. See the ticket here: https://www.assembla.com/spaces/scala-ide/tickets/1001326#/activity/ticket:
I have a fix for this but I need to port my tests from the IDE to the compiler before I can have a pull request ready.
[1] There is an exception to this though. Some of the nodes that
the compiler generates will actually contain symbols. I've
chosen to just ignore these special cases for now.
The text was updated successfully, but these errors were encountered: