@@ -52,12 +52,12 @@ object CheckCaptures:
5252 * @param outer0 the next enclosing environment
5353 */
5454 case class Env (
55- owner : Symbol ,
56- nestedInOwner : Boolean ,
57- captured : CaptureSet ,
58- isBoxed : Boolean ,
59- outer0 : Env | Null
60- ) :
55+ owner : Symbol ,
56+ nestedInOwner : Boolean ,
57+ captured : CaptureSet ,
58+ isBoxed : Boolean ,
59+ outer0 : Env | Null ) :
60+
6161 def outer = outer0.nn
6262
6363 def isOutermost = outer0 == null
@@ -433,7 +433,7 @@ class CheckCaptures extends Recheck, SymTransformer:
433433 case defn.FunctionOf (ptformals, _, _)
434434 if ptformals.nonEmpty && ptformals.forall(_.captureSet.isAlwaysEmpty) =>
435435 // Redo setup of the anonymous function so that formal parameters don't
436- // get capture sets. This is important to avoid false widenings to `* `
436+ // get capture sets. This is important to avoid false widenings to `cap `
437437 // when taking the base type of the actual closures's dependent function
438438 // type so that it conforms to the expected non-dependent function type.
439439 // See withLogFile.scala for a test case.
@@ -582,7 +582,7 @@ class CheckCaptures extends Recheck, SymTransformer:
582582 refs.disallowRootCapability { () =>
583583 val kind = if tree.isInstanceOf [ValDef ] then " mutable variable" else " expression"
584584 report.error(
585- em """ The $kind's type $wtp is not allowed to capture the root capability `* `.
585+ em """ The $kind's type $wtp is not allowed to capture the root capability `cap `.
586586 |This usually means that a capability persists longer than its allowed lifetime. """ ,
587587 tree.srcPos)
588588 }
@@ -768,9 +768,9 @@ class CheckCaptures extends Recheck, SymTransformer:
768768 styp1.capturing(if alwaysConst then CaptureSet (cs1.elems) else cs1).forceBoxStatus(resultBoxed)
769769
770770 if needsAdaptation then
771- val criticalSet = // the set which is not allowed to have `* `
772- if covariant then cs1 // can't box with `* `
773- else expected.captureSet // can't unbox with `* `
771+ val criticalSet = // the set which is not allowed to have `cap `
772+ if covariant then cs1 // can't box with `cap `
773+ else expected.captureSet // can't unbox with `cap `
774774 if criticalSet.isUniversal && expected.isValueType then
775775 // We can't box/unbox the universal capability. Leave `actual` as it is
776776 // so we get an error in checkConforms. This tends to give better error
@@ -779,11 +779,11 @@ class CheckCaptures extends Recheck, SymTransformer:
779779 println(i " cannot box/unbox $actual vs $expected" )
780780 actual
781781 else
782- // Disallow future addition of `* ` to `criticalSet`.
782+ // Disallow future addition of `cap ` to `criticalSet`.
783783 criticalSet.disallowRootCapability { () =>
784784 report.error(
785785 em """ $actual cannot be box-converted to $expected
786- |since one of their capture sets contains the root capability `* ` """ ,
786+ |since one of their capture sets contains the root capability `cap ` """ ,
787787 pos)
788788 }
789789 if ! insertBox then // unboxing
@@ -922,8 +922,8 @@ class CheckCaptures extends Recheck, SymTransformer:
922922 * usingLogFile[box ?1 () -> Unit] { (f: {*} File) => () => { f.write(0) } }
923923 *
924924 * We may propagate `f` into ?1, making ?1 ill-formed.
925- * This also causes soundness issues, since `f` in ?1 should be widened to `* `,
926- * giving rise to an error that `* ` cannot be included in a boxed capture set.
925+ * This also causes soundness issues, since `f` in ?1 should be widened to `cap `,
926+ * giving rise to an error that `cap ` cannot be included in a boxed capture set.
927927 *
928928 * To solve this, we still allow ?1 to capture parameter refs like `f`, but
929929 * compensate this by pushing the widened capture set of `f` into ?1.
0 commit comments