-
Notifications
You must be signed in to change notification settings - Fork 1.1k
TASTy should list the types of template parents #8028
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
Comments
As far as I know, one way of doing it in Scala 2 is through symbols. One can call This does not seem possible with the current API, but it would be very useful. Also, is there a reason why we cannot list the |
I has been possible to optimise reading the parents by shortcutting traversals to only go as far as identifying the prefix of a parent constructor. Which may be cached in a simple tree if seen before within the same tasty file |
Even if you found a more efficient workaround, I still believe that this information not being available at our fingers is an issue, that needs fixing. I'll reopen so that this doesn't get lost. |
for the definition class Lexeme private (private val str: String) extends AnyVal with Ordered[Lexeme] {
def compare(that: Lexeme) = str.compareTo(that.str)
} the tasty we care about looks like
and we can basically skip Address 22 as there is no need to resolve the constructor and complex trees can be avoided for IDENTtpt and APPLIEDtpt, just use the simple TypeTree wrapper |
Currently in order to unpickle the parents of a template in TASTy, you must parse many arbitrary trees including selecting the correct overloaded constructor, and performing unification of type variables on the return type of that constructor.
In Scala 2 all that is required is the types of the parents; it is inefficient to traverse expressions to calculate and propagate a type.
there should be a simple list of types enumerating the parents, that can be referenced to from the actual trees that make up the extends clauses.
The text was updated successfully, but these errors were encountered: