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

Track import selector of implicit info in search #10645

Merged
merged 2 commits into from
Jan 15, 2024

Conversation

som-snytt
Copy link
Contributor

For recording when import selectors have been "used", record selector only after successful implicit search; for other look-ups, avoid recording during implicit search.

Fixes scala/bug#12690

@scala-jenkins scala-jenkins added this to the 2.13.14 milestone Dec 28, 2023
@som-snytt som-snytt modified the milestones: 2.13.14, 2.13.13 Jan 14, 2024
@som-snytt som-snytt marked this pull request as ready for review January 14, 2024 02:20
@som-snytt
Copy link
Contributor Author

The build error was not an obscure false positive; a few files pick up strip margin interpolator via
https://github.com/scala/scala/blob/2.13.x/src/compiler/scala/tools/nsc/package.scala#L40

Copy link
Member

@lrytz lrytz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks!

val res = typedImplicit(firstPending, ptChecked = true, isLocalToCallsite)
if (res.isFailure) res
else
new SearchResult(res.tree, res.subst, res.undetparams, firstPending)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I see it's simpler to register the ImplicitInfo here 👍

@lrytz lrytz merged commit aa99433 into scala:2.13.x Jan 15, 2024
4 checks passed
@som-snytt som-snytt deleted the issue/12690-import-commit branch January 15, 2024 18:32
@som-snytt
Copy link
Contributor Author

As hinted on the ticket, I see from a stale branch that work began at that time. I say, "at that time", yet what is time, but a vapor?

Author: Som Snytt <som.snytt@gmail.com>
Date:   Sat Nov 12 10:48:08 2022 -0800

    Record selector usage after implicit ranking

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.

Missing "unused import" warning when implicit is considered but discarded
3 participants