-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Change cc syntax #17377
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
Change cc syntax #17377
Conversation
- `^{xs}` in postfix
- `->{xs}` after arrow
- `any` instead of `*`
Use ^ and => shorthands instead.
And fine tune distinction of ^ as postfix or infix operator
Recognize as trailing in front of `->` or `?->`
... and fix a missing change when printing trees
Linyxus
left a comment
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.
Otherwise LGTM!
| isOperator = !followingIsVararg() && !isPureArrow) | ||
|
|
||
| /** RefinedType ::= WithType {[nl] Refinement} | ||
| /** RefinedType ::= WithType {[nl] (Refinement} [`^` CaptureSet] |
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.
There is an extra ( in the comment.
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.
tests/neg-custom-args/boxmap.scala
Outdated
| val x: (b: Box[A]) -> (f: A => B) ->{b, f} (() -> Box[B]) = lazymap[A, B] // works | ||
| val y: (b: Box[A]) -> (f: A => B) ->{cap} (() -> Box[B]) = lazymap[A, B] // works |
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.
| val x: (b: Box[A]) -> (f: A => B) ->{b, f} (() -> Box[B]) = lazymap[A, B] // works | |
| val y: (b: Box[A]) -> (f: A => B) ->{cap} (() -> Box[B]) = lazymap[A, B] // works | |
| val x: (b: Box[A]) -> (f: A => B) -> (() ->{b, f} Box[B]) = lazymap[A, B] // works | |
| val y: (b: Box[A]) -> (f: A => B) -> (() ->{cap} Box[B]) = lazymap[A, B] // works |
Abolish restriction that box/unbox cannot be done with `cap`.
Instead, do a deep check for `cap`
- in type arguments for `sealed` type variables
- in the types of mutable vars
- in the type of `try` under the `saferExceptions` language import
The `caps.unsafe.{unsafeBox, unsafeUnbox, unsafeBoxFunArg}` methods are
not longer
needed and are deprecated. Instead there is an annotation
`annotation.unchecked.uncheckedCaptures` that
can be added to a mutable variable to turn off checking its type.
These changes in behavior are introduced in 3.3. Older source versions
still support the old behavior (which corresponds to the paper).
So to run examples in the paper as described there, they need a `-source
3.2` or a
language import.
Based on #17377
Trial: change cc syntax