Skip to content

Commit

Permalink
Update a test related to library cc
Browse files Browse the repository at this point in the history
  • Loading branch information
noti0na1 committed Nov 29, 2024
1 parent 10bb2e6 commit ae00703
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
22 changes: 11 additions & 11 deletions tests/neg-custom-args/captures/i21614.check
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/i21614.scala:9:33 ----------------------------------------
9 | files.map((f: F) => new Logger(f)) // error, Q: can we make this pass (see #19076)?
| ^
| Found: (f : F^)
| Required: File^
|
| longer explanation available when compiling with `-explain`
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/i21614.scala:12:12 ---------------------------------------
12 | files.map(new Logger(_)) // error, Q: can we improve the error message?
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/i21614.scala:12:33 ---------------------------------------
12 | files.map((f: F) => new Logger(f)) // error, Q: can we make this pass (see #19076)?
| ^
| Found: (f : F^)
| Required: File^
|
| longer explanation available when compiling with `-explain`
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/i21614.scala:15:12 ---------------------------------------
15 | files.map(new Logger(_)) // error, Q: can we improve the error message?
| ^^^^^^^^^^^^^
| Found: (_$1: box File^{files*}) ->{files*} (ex$13: caps.Exists) -> box Logger{val f: File^{_$1}}^{ex$13}
| Required: (_$1: box File^{files*}) -><fluid> box Logger{val f: File^?}^?
| Found: (_$1: box File^{files*}) ->{files*} (ex$16: caps.Exists) -> box Logger{val f: File^{_$1}}^{ex$16}
| Required: (_$1: box File^{files*}) => box Logger{val f: File^?}^?
|
| Note that the universal capability `cap`
| cannot be included in capture set ?
Expand Down
3 changes: 3 additions & 0 deletions tests/neg-custom-args/captures/i21614.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import language.experimental.captureChecking
import caps.Capability
import caps.use

trait List[+T]:
def map[U](f: T => U): List[U]

trait File extends Capability
class Logger(f: File^) extends Capability // <- will work if we remove the extends clause

Expand Down

0 comments on commit ae00703

Please sign in to comment.