Skip to content

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

@matanox

Description

@matanox

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions