-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Spec: Opaque type aliases. #17947
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
Spec: Opaque type aliases. #17947
Conversation
d499013
to
248e014
Compare
Opaque type aliases cannot be `private` and cannot be overridden in subclasses. | ||
Opaque type aliases cannot have a context function type as right-hand side. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like these restrictions are not mentioned
## Type Parameters of Opaque Types | ||
|
||
Opaque type aliases can have a single type parameter list. The following aliases | ||
are well-formed | ||
```scala | ||
opaque type F[T] = (T, T) | ||
opaque type G = [T] =>> List[T] | ||
``` | ||
but the following are not: | ||
```scala | ||
opaque type BadF[T] = [U] =>> (T, U) | ||
opaque type BadG = [T] =>> [U] => (T, U) | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again this restriction is not mentioned
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like some points are missing in the spec
248e014
to
5b74c9b
Compare
Good catch about the missing restrictions! I have added them. |
5b74c9b
to
229738f
Compare
Backports #17947 to the LTS branch. PR submitted by the release tooling. [skip ci]
[skip ci]
Based on #17940.