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

Allow for redundant type checks for pattern matching #1489

Merged
merged 1 commit into from
Dec 1, 2023

Conversation

mario-bucev
Copy link
Collaborator

Allows for ascribing type parameters to e.g. tuples patterns, such as in the following snippet:

def test[A, B, C](a: A, b: B, c: C): Unit = {
  // annotating aa, bb and cc with their respecting type
  val (aa: A, bb: B, cc: C) = (a, b, c)
}

This was previously rejected.
Note that the Scala 2 compiler will issue spurious warnings saying that these type tests cannot be checked at runtime (which is true, but they can be checked at compile time 😋).

@mario-bucev mario-bucev merged commit b46f01f into epfl-lara:main Dec 1, 2023
2 checks passed
@mario-bucev mario-bucev deleted the redundant-patterns branch December 1, 2023 09:53
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.

1 participant