Skip to content

Fix #6697: Ingore bounds checks in match type patterns #7214

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
Oct 3, 2019

Conversation

OlivierBlanvillain
Copy link
Contributor

Similarly to what's done for values when we write case _: F[x], there is no need to check that x conforms to its bounds as we are currently binding it.

@@ -306,6 +306,15 @@ class PostTyper extends MacroTransform with IdentityDenotTransformer { thisPhase
// case x: Tree[?]
// (which translates to)
// case x: (_: Tree[?])
case m @ MatchTypeTree(bounds, selector, cases) =>
// Analog to the case above for match types
def ignoreBoundsCheck(x: CaseDef): CaseDef =
Copy link
Contributor

Choose a reason for hiding this comment

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

transformWithoutBoundsCheck or tranformIgnoringBoundsCheck maybe?

Similarly to what's done for values when we write `case _: F[x]`, there
is no need to check that `x` conforms to its bounds as we are currently
binding it.
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.

2 participants