@@ -685,7 +685,7 @@ class Setup extends PreRecheck, SymTransformer, SetupAPI:
685685 // Infer the self type for the rest, which is all classes without explicit
686686 // self types (to which we also add nested module classes), provided they are
687687 // neither pure, nor are publicily extensible with an unconstrained self type.
688- val cs = CaptureSet .Var (cls)
688+ val cs = CaptureSet .ProperVar (cls, CaptureSet .emptyRefs, nestedOK = false )
689689 if cls.derivesFrom(defn.Caps_Capability ) then
690690 // If cls is a capability class, we need to add a fresh readonly capability to
691691 // ensure we cannot treat the class as pure.
@@ -852,7 +852,7 @@ class Setup extends PreRecheck, SymTransformer, SetupAPI:
852852
853853 /** Add a capture set variable to `tp` if necessary. */
854854 private def addVar (tp : Type , owner : Symbol )(using Context ): Type =
855- decorate(tp, CaptureSet .Var (owner, _, nestedOK = ! ctx.mode.is(Mode .CCPreciseOwner )))
855+ decorate(tp, CaptureSet .ProperVar (owner, _, nestedOK = ! ctx.mode.is(Mode .CCPreciseOwner )))
856856
857857 /** A map that adds <fluid> capture sets at all contra- and invariant positions
858858 * in a type where a capture set would be needed. This is used to make types
0 commit comments