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

CompilerControl.parseTree can in certain conditions return a typed tree #7026

Closed
scabug opened this issue Jan 26, 2013 · 3 comments
Closed
Assignees
Labels
Milestone

Comments

@scabug
Copy link

scabug commented Jan 26, 2013

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:

  1. You get a new parse tree every time you ask for one
  2. A parse tree should never contain any symbols or types [1]
  3. 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'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.

@scabug
Copy link
Author

scabug commented Jan 26, 2013

@scabug
Copy link
Author

scabug commented Feb 7, 2013

@adriaanm said:
scala/scala#1993

@scabug
Copy link
Author

scabug commented Feb 7, 2013

@JamesIry said:
"Assigning" to Adriaan so it doesn't look like nobody is working on it.

@scabug scabug closed this as completed Feb 7, 2013
@scabug scabug added the has PR label Apr 7, 2017
@scabug scabug added this to the 2.10.1 milestone Apr 7, 2017
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