Skip to content

Commit b18794c

Browse files
committed
Update doc pages
New doc page on mutability, split off from "Separation Checking".
1 parent 8be4451 commit b18794c

File tree

5 files changed

+463
-195
lines changed

5 files changed

+463
-195
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,8 @@ extension (tp: Type)
352352
case _ =>
353353
false
354354

355-
/** Is this a type extending `Mutable` that has update methods
356-
* or non-private mutable fields?
355+
/** Is this a type extending `Mutable` that has non-private update methods
356+
* or mutable fields?
357357
*/
358358
def isMutableType(using Context): Boolean =
359359
tp.derivesFrom(defn.Caps_Mutable)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -640,9 +640,9 @@ object CaptureSet:
640640
else ""
641641

642642
private def capImpliedByCapability(parent: Type)(using Context): Capability =
643-
if parent.derivesFromExclusive then GlobalCap.readOnly else GlobalCap
643+
if parent.derivesFromMutable then GlobalCap.readOnly else GlobalCap
644644

645-
/* The same as {cap.rd} but generated implicitly for references of Capability subtypes.
645+
/* The same as {cap} but generated implicitly for references of Capability subtypes.
646646
*/
647647
class CSImpliedByCapability(parent: Type)(using @constructorOnly ctx: Context)
648648
extends Const(SimpleIdentitySet(capImpliedByCapability(parent)))

0 commit comments

Comments
 (0)