Skip to content

Fix issue with certain polyfunctions not properly matching in macros #23614

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 1 commit into from
Jul 29, 2025

Conversation

jchyb
Copy link
Contributor

@jchyb jchyb commented Jul 28, 2025

Fixes #23589
previously the contents of TypeBoundsTree were directly compared with the types of defn.Nothing and defn.Any, which caused an issue where:

  • def.Nothing.tpe equals TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Nothing)
  • while the analogous type unpicked from quoted code was TermRef(ThisType(TypeRef(NoPrefix,module class <root>)),object scala),Nothing)

Same situation with the upper type bound Any. isAny and isNothingType accept both types, so they are now used instead.

@jchyb jchyb force-pushed the fix-i23589-quoted-pattern branch from 53679ac to 55732ab Compare July 29, 2025 08:34
@jchyb jchyb requested a review from hamzaremmal July 29, 2025 11:47
@hamzaremmal hamzaremmal merged commit ad95e58 into scala:main Jul 29, 2025
39 checks passed
@hamzaremmal hamzaremmal deleted the fix-i23589-quoted-pattern branch July 29, 2025 13:29
@WojciechMazur WojciechMazur added this to the 3.7.3 milestone Jul 29, 2025
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.

Quoted pattern matching of poly functions does not work with quoted code
3 participants