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

Followup improvements to RefChecks #9815

Merged
merged 1 commit into from Nov 30, 2021
Merged

Followup improvements to RefChecks #9815

merged 1 commit into from Nov 30, 2021

Conversation

joroKr21
Copy link
Member

  • Only convert unbound existential types to wildcards.
  • Extend undesired properties check to patterns.

Followup to #9806
Fixes scala/bug#12493

@scala-jenkins scala-jenkins added this to the 2.13.8 milestone Nov 28, 2021
  * Only convert unbound existential types to wildcards.
  * Extend undesired properties check to patterns.
@@ -290,7 +291,7 @@ trait TypeTags { self: Universe =>

def apply[T](mirror1: scala.reflect.api.Mirror[self.type], tpec1: TypeCreator): TypeTag[T] = {
(mirror1: AnyRef) match {
case m: scala.reflect.runtime.JavaMirrors#MirrorImpl
case m: scala.reflect.runtime.JavaMirrors#JavaMirror @nowarn("cat=deprecation")
Copy link
Member Author

@joroKr21 joroKr21 Nov 28, 2021

Choose a reason for hiding this comment

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

Type projection causes dealias revealing the deprecated type underneath. The same happens if we use scala.reflect.runtime.JavaMirrors#MirrorImpl outside of a pattern.

@joroKr21 joroKr21 marked this pull request as ready for review November 28, 2021 14:09
@joroKr21 joroKr21 requested a review from lrytz November 28, 2021 14:09
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.

Thank you! Interesting interplay of two type maps :)

@lrytz lrytz merged commit e814d78 into scala:2.13.x Nov 30, 2021
@joroKr21 joroKr21 deleted the ref-checks branch November 30, 2021 10:06
@joroKr21
Copy link
Member Author

Yes, interesting indeed - switching from testing that the existential quantifier is bound from outside vs not bound from inside makes the difference.

@lrytz
Copy link
Member

lrytz commented Nov 30, 2021

This revealed usages of Java 17 deprecated API

[error] D:\a\scala\scala\src\library\scala\sys\SystemProperties.scala:56:36: class AccessControlException in package security is deprecated
[error]     try Some(body) catch { case _: AccessControlException => None }
[error]                                    ^

I'll send a follow-up.

SethTisue added a commit to SethTisue/scala that referenced this pull request Dec 1, 2021
a little sequel to scala#9815, which is responsible for newly and rightly
emitting these warnings
@SethTisue
Copy link
Member

I'll send a follow-up.

not if I beat you to it! #9816

@SethTisue SethTisue added release-notes worth highlighting in next release notes and removed release-notes worth highlighting in next release notes labels Dec 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants