Skip to content

Scaladoc: further definition lookup fixes #11339

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

Merged
merged 2 commits into from
Feb 15, 2021

Conversation

abgruszecki
Copy link
Contributor

Lookup supports DFS now, and duplicates more of Scaladoc's old behaviour.

Fixes majority of remaining lookup warnings in stdlib.

@abgruszecki abgruszecki marked this pull request as ready for review February 8, 2021 10:18
@abgruszecki abgruszecki linked an issue Feb 8, 2021 that may be closed by this pull request
@abgruszecki
Copy link
Contributor Author

@romanowski this PR deals with most of the remaining lookup issues in stdlib. The logic needed to be changed to be closer to original Scaladoc - it was more like Dottydoc before this PR.

We now look up the query in top-level scope to start with, then, if that fails, we look it up in every enclosing scope, including every enclosing package. This seems to be how Scaladoc behaved previously. We also do a DFS when looking up the definitions - for instance, when looking up Array.fill, we first treat Array as a class, fail to look up fill, then retreat to treating Array as object and succeed.

I'll open a PR with associated documentation changes sometime later this week.

@abgruszecki
Copy link
Contributor Author

FYI right now #11306 and #11305 are, at a glance, the only problems remaining with definition lookup in the doctool.

#11305 could be easily fixed if we could generate a DRI for an inherited definition. From the perspective of definition lookup, it's just a matter of returning two symbols instead of one: one for the definition we looked up, one for the "parent" of the definition, i.e. the symbol through which we looked up the first one.

Lookup supports DFS now, and duplicates more of Scaladoc's old behaviour.

Fixes majority of remaining lookup warnings in stdlib.
@romanowski romanowski force-pushed the scala3doc/more-lookup-fixes branch from 027dac1 to b866f79 Compare February 15, 2021 08:05
@romanowski romanowski enabled auto-merge February 15, 2021 10:00
@romanowski romanowski merged commit 05c478b into scala:master Feb 15, 2021
@romanowski romanowski deleted the scala3doc/more-lookup-fixes branch February 15, 2021 10:40
@Kordyjan Kordyjan added this to the 3.0.0 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Doctool: add DFS member lookup
3 participants