Skip to content

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
@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