File tree 2 files changed +14
-11
lines changed
tests/neg-custom-args/captures
2 files changed +14
-11
lines changed Original file line number Diff line number Diff line change 1
- -- [E007] Type Mismatch Error: tests/neg-custom-args/captures/i21614.scala:9 :33 - ---------------------------------------
2
- 9 | files.map((f: F) => new Logger(f)) // error, Q: can we make this pass (see #19076)?
3
- | ^
4
- | Found: (f : F^)
5
- | Required: File^
6
- |
7
- | longer explanation available when compiling with `-explain`
8
- -- [E007] Type Mismatch Error: tests/neg-custom-args/captures/i21614.scala:12 :12 ---------------------------------------
9
- 12 | files.map(new Logger(_)) // error, Q: can we improve the error message?
1
+ -- [E007] Type Mismatch Error: tests/neg-custom-args/captures/i21614.scala:12 :33 ---------------------------------------
2
+ 12 | files.map((f: F) => new Logger(f)) // error, Q: can we make this pass (see #19076)?
3
+ | ^
4
+ | Found: (f : F^)
5
+ | Required: File^
6
+ |
7
+ | longer explanation available when compiling with `-explain`
8
+ -- [E007] Type Mismatch Error: tests/neg-custom-args/captures/i21614.scala:15 :12 ---------------------------------------
9
+ 15 | files.map(new Logger(_)) // error, Q: can we improve the error message?
10
10
| ^^^^^^^^^^^^^
11
- | Found: (_$1: box File^{files*}) ->{files*} (ex$13 : caps.Exists) -> box Logger{val f: File^{_$1}}^{ex$13 }
12
- | Required: (_$1: box File^{files*}) -><fluid > box Logger{val f: File^?}^?
11
+ | Found: (_$1: box File^{files*}) ->{files*} (ex$16 : caps.Exists) -> box Logger{val f: File^{_$1}}^{ex$16 }
12
+ | Required: (_$1: box File^{files*}) = > box Logger{val f: File^?}^?
13
13
|
14
14
| Note that the universal capability `cap`
15
15
| cannot be included in capture set ?
Original file line number Diff line number Diff line change @@ -2,6 +2,9 @@ import language.experimental.captureChecking
2
2
import caps .Capability
3
3
import caps .use
4
4
5
+ trait List [+ T ]:
6
+ def map [U ](f : T => U ): List [U ]
7
+
5
8
trait File extends Capability
6
9
class Logger (f : File ^ ) extends Capability // <- will work if we remove the extends clause
7
10
You can’t perform that action at this time.
0 commit comments