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

Add support for denotation by tree #1311

Closed
ShaneDelmore opened this issue Feb 14, 2018 · 5 comments
Closed

Add support for denotation by tree #1311

ShaneDelmore opened this issue Feb 14, 2018 · 5 comments
Labels

Comments

@ShaneDelmore
Copy link
Contributor

A common request is to get the denotation of a tree. As a rough guess this would be the denotation of the last element in the tree unless it is a block, in which case it would be the denotation of the last statement in the block.

@xeno-by
Copy link
Member

xeno-by commented Feb 14, 2018

Can you give an example?

@olafurpg
Copy link
Member

If I understand correctly, this sounds like Term.tpe which will require https://github.com/scalameta/scalameta/issues?q=is%3Aissue+is%3Aopen+label%3ASymtab

@ShaneDelmore
Copy link
Contributor Author

@olafurpg What is the current proper usage of index.denotation(tree)? This came up as the last couple of times I have paired with people working with scalameta and scalafix this is a thing that frequently looks useful based on type signatures, but always results in None. I might be misunderstanding when I should be looking for denotation vs tpe

@olafurpg
Copy link
Member

that method is a shorthand for denotation(symbol(tree)), it should return results for refs (a, a.b) etc but more complex expressions it's expected to return none

@olafurpg
Copy link
Member

Duplicate of #1212. You can query the type of a symbol with the current api but not a term.

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

3 participants