Skip to content

Commit 5a4eb78

Browse files
committed
Add capture checking to scala.caps
1 parent f9ea556 commit 5a4eb78

File tree

6 files changed

+10
-2
lines changed

6 files changed

+10
-2
lines changed

TODO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
- [ ] library/src/scala/annotation/unchecked/uncheckedCapabilityLeaks.scala
5050
- [ ] library/src/scala/annotation/unchecked/uncheckedCaptures.scala
5151
- [ ] library/src/scala/annotation/unroll.scala
52-
- [ ] library/src/scala/caps/package.scala
52+
- [x] library/src/scala/caps/package.scala
5353
- [ ] library/src/scala/compiletime/ops/any.scala
5454
- [ ] library/src/scala/compiletime/ops/boolean.scala
5555
- [ ] library/src/scala/compiletime/ops/double.scala

compiler/src/dotty/tools/dotc/cc/Synthetics.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,4 +168,4 @@ object Synthetics:
168168
transformCompareCaptures)
169169
end transform
170170

171-
end Synthetics
171+
end Synthetics

library/src/scala/caps/package.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package scala
22
package caps
33

4+
import language.experimental.captureChecking
5+
46
import annotation.{experimental, compileTimeOnly, retainsCap}
57

68
/**

library/src/scala/compiletime/testing/Error.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package scala.compiletime.testing
22

3+
import language.experimental.captureChecking
4+
35
/** Represents a compile-time error.
46
*
57
* @see scala.compiletime.testing.typeCheckErrors

library/src/scala/compiletime/testing/ErrorKind.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package scala.compiletime.testing
22

3+
import language.experimental.captureChecking
4+
35
/** An error can be either a parse-time or a typecheck-time */
46
sealed trait ErrorKind // This should be an enum but currently, Dotty lib fails to
57
// compile with an obscure error.

library/src/scala/compiletime/testing/package.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package scala.compiletime
22
package testing
33

4+
import language.experimental.captureChecking
5+
46
/** Whether the code type checks in the current context?
57
*
68
* An inline definition with a call to `typeChecks` should be transparent.

0 commit comments

Comments
 (0)