@@ -685,7 +685,7 @@ class Setup extends PreRecheck, SymTransformer, SetupAPI:
685
685
// Infer the self type for the rest, which is all classes without explicit
686
686
// self types (to which we also add nested module classes), provided they are
687
687
// 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 )
689
689
if cls.derivesFrom(defn.Caps_Capability ) then
690
690
// If cls is a capability class, we need to add a fresh readonly capability to
691
691
// ensure we cannot treat the class as pure.
@@ -852,7 +852,7 @@ class Setup extends PreRecheck, SymTransformer, SetupAPI:
852
852
853
853
/** Add a capture set variable to `tp` if necessary. */
854
854
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 )))
856
856
857
857
/** A map that adds <fluid> capture sets at all contra- and invariant positions
858
858
* in a type where a capture set would be needed. This is used to make types
0 commit comments