-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expand Capability types T to T^ only if no explicit capture set is gi…
…ven (#21375) If C is a class extending caps.Capability we used to always expand C to C^, even if there was an explicitly given capture set. For instance `C^{x}` got expanded to `C^{cap}^{x}` which caused a redundant capture x warning. We now do this expansion only if there is no explicitly given capture set. @natsukagami I hope this helps the Async use case.
- Loading branch information
Showing
4 changed files
with
30 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
//> using options -Werror | ||
import caps.Capability | ||
|
||
trait Buffer[T] extends Capability: | ||
def append(x: T): this.type | ||
|
||
def f(buf: Buffer[Int]) = | ||
val buf1 = buf.append(1).append(2) | ||
val buf2: Buffer[Int]^{buf1} = buf1 | ||
|
||
|
||
|