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

Scala 3 migration warning for implicits found in package prefix #10621

Merged
merged 1 commit into from Jan 30, 2024

Conversation

lrytz
Copy link
Member

@lrytz lrytz commented Dec 4, 2023

The implicit scope in Scala 3 no longer includes the requested type's package prefix.

Includes commits of #10573.

Fixes scala/bug#12919

@lrytz
Copy link
Member Author

lrytz commented Dec 4, 2023

Seems to be green.

A question is: if an implicit is available both by an import as well as through a prefix of the requested type, is the imported one preferred by spec, by implementation, or just by luck? It seems to be the case in the test as we're not seeing the warning once the import is added, but I haven't checked why.

@som-snytt
Copy link
Contributor

Sorry if I don't understand the question, but implicits in lexical scope are checked before implicit scope. The package prefix was a "part" of the type that contributes to implicit scope.

@som-snytt som-snytt self-requested a review December 4, 2023 20:07
Copy link
Contributor

@som-snytt som-snytt left a comment

Choose a reason for hiding this comment

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

You make it look easy.

SethTisue

This comment was marked as resolved.

@lrytz lrytz force-pushed the t12919 branch 2 times, most recently from 872fd69 to bcdb45c Compare January 18, 2024 10:23
@lrytz

This comment was marked as resolved.

@SethTisue SethTisue self-assigned this Jan 18, 2024
@SethTisue SethTisue marked this pull request as draft January 18, 2024 18:33
@SethTisue

This comment was marked as resolved.

@som-snytt
Copy link
Contributor

Just yesterday I was saying, Didn't they undeprecate package object inheritance?

@lrytz
Copy link
Member Author

lrytz commented Jan 29, 2024

@SethTisue

This comment was marked as resolved.

@SethTisue SethTisue assigned lrytz and unassigned SethTisue Jan 30, 2024
The implicit scope in Scala 3 no longer includes the requested
type's package prefix
@lrytz lrytz marked this pull request as ready for review January 30, 2024 13:28
@SethTisue SethTisue assigned SethTisue and unassigned lrytz Jan 30, 2024
@SethTisue SethTisue merged commit d9c839c into scala:2.13.x Jan 30, 2024
3 checks passed
@SethTisue
Copy link
Member

community build regressions here; see scala/community-build#1710 (comment)

@SethTisue
Copy link
Member

followup PR is #10685

@SethTisue SethTisue added the release-notes worth highlighting in next release notes label Feb 10, 2024
xerial added a commit to wvlet/airframe that referenced this pull request Feb 27, 2024
@xuwei-k
Copy link
Contributor

xuwei-k commented Mar 4, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes worth highlighting in next release notes
Projects
None yet
5 participants