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

Adapt to 2.11 compiler providing .pos.source but no .sourceFile #8

Open
matanox opened this issue Dec 5, 2015 · 1 comment
Open
Labels

Comments

@matanox
Copy link
Member

matanox commented Dec 5, 2015

For a given global.Symbol, .sourceFile may return null, whereas pos.source (when the latter is defined) returns a value. Quite certainly a small compiler quirk. Right now the code only looks at .sourceFile. Observed for https://github.com/allenai/pipeline.

So in those cases (seems to be rare) where only pos.source has the path, then we likely miss out on correlating a symbol to a given source and location. Worst, as it currently stands we also deduce whether a symbol is external v.s. project-defined by this value.

So we should likely grab .pos.source if it has something, when .sourceFile does not - everywhere that the latter is currently being used. Which means wrap this all as our own getSourcePath(global.Symbol): Option[String] method somewhere.

@matanox matanox added the minor label Dec 5, 2015
matanox added a commit that referenced this issue Dec 5, 2015
@matanox
Copy link
Member Author

matanox commented Dec 5, 2015

Note that for debug, .pos itself is not always defined, so .pos.source shouldn't be attempted except when .pos is defined. So precede if (symbol.pos.toString == "NoPosition") to it.

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

1 participant