Skip to content

Commit d839bcc

Browse files
committed
Add doc comment to Pure trait.
1 parent 43ef239 commit d839bcc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

library/src/scala/caps/Pure.scala

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ import language.experimental.captureChecking
66
/** A marker trait that declares that all inheriting classes are "pure" in the
77
* sense that their values retain no capabilities including capabilities needed
88
* to perform effects. This has formal meaning only under capture checking.
9+
*
10+
* NOTE: If an upper bound is Pure, we check that an argument conforms to it only
11+
* in sources where capture checking is enabled. For instance,
12+
*
13+
* def f[C <: Pure]()
14+
* f[Object]()
15+
*
16+
* would give an error only under capture checking. Pure is also dropped in
17+
* upper bounds if it forms part of an &-type, or is under a type lambda.
918
*/
1019
trait Pure:
1120
this: Pure =>

0 commit comments

Comments
 (0)