Skip to content

Commit b0d0611

Browse files
committed
Rename rigid --> hard
1 parent bf7356e commit b0d0611

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

compiler/src/dotty/tools/dotc/core/TypeComparer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
494494

495495
def hardenTypeVars(tp2: Type): Unit = tp2.dealiasKeepRefiningAnnots match
496496
case tvar: TypeVar if constraint.contains(tvar.origin) =>
497-
state.rigidVars += tvar
497+
state.hardVars += tvar
498498
case tp2: TypeParamRef if constraint.contains(tp2) =>
499499
hardenTypeVars(constraint.typeVarOfParam(tp2))
500500
case tp2: AndOrType =>

compiler/src/dotty/tools/dotc/core/TyperState.scala

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ object TyperState {
2929
def snapshot()(using Context): Snapshot =
3030
var previouslyInstantiated: TypeVars = SimpleIdentitySet.empty
3131
for tv <- ts.ownedVars do if tv.inst.exists then previouslyInstantiated += tv
32-
(ts.constraint, ts.ownedVars, previouslyInstantiated, ts.rigidVars)
32+
(ts.constraint, ts.ownedVars, previouslyInstantiated, ts.hardVars)
3333

3434
def resetTo(state: Snapshot)(using Context): Unit =
3535
val (c, tvs, previouslyInstantiated, rvars) = state
@@ -38,7 +38,7 @@ object TyperState {
3838
tv.resetInst(ts)
3939
ts.ownedVars = tvs
4040
ts.constraint = c
41-
ts.rigidVars = rvars
41+
ts.hardVars = rvars
4242
}
4343

4444
class TyperState() {
@@ -94,9 +94,9 @@ class TyperState() {
9494
* its lower bound, top-level soft unions in the instance type are converted
9595
* to hard unions instead of being widened in `widenOr`.
9696
*/
97-
private var myRigidVars: TypeVars = _
98-
def rigidVars: TypeVars = myRigidVars
99-
def rigidVars_=(tvs: TypeVars): Unit = myRigidVars = tvs
97+
private var myHardVars: TypeVars = _
98+
def hardVars: TypeVars = myHardVars
99+
def hardVars_=(tvs: TypeVars): Unit = myHardVars = tvs
100100

101101
/** Initializes all fields except reporter, isCommittable, which need to be
102102
* set separately.
@@ -108,7 +108,7 @@ class TyperState() {
108108
this.myConstraint = constraint
109109
this.previousConstraint = constraint
110110
this.myOwnedVars = SimpleIdentitySet.empty
111-
this.myRigidVars = SimpleIdentitySet.empty
111+
this.myHardVars = SimpleIdentitySet.empty
112112
this.isCommitted = false
113113
this
114114

@@ -119,7 +119,7 @@ class TyperState() {
119119
val ts = TyperState().init(this, this.constraint)
120120
.setReporter(reporter)
121121
.setCommittable(committable)
122-
ts.rigidVars = this.rigidVars
122+
ts.hardVars = this.hardVars
123123
ts
124124

125125
/** The uninstantiated variables */
@@ -173,7 +173,7 @@ class TyperState() {
173173
constr.println(i"committing $this to $targetState, fromConstr = $constraint, toConstr = ${targetState.constraint}")
174174
if targetState.constraint eq previousConstraint then
175175
targetState.constraint = constraint
176-
targetState.rigidVars = rigidVars
176+
targetState.hardVars = hardVars
177177
if !ownedVars.isEmpty then ownedVars.foreach(targetState.includeVar)
178178
else
179179
targetState.mergeConstraintWith(this)
@@ -226,7 +226,7 @@ class TyperState() {
226226
val otherLos = other.lower(p)
227227
val otherHis = other.upper(p)
228228
val otherEntry = other.entry(p)
229-
if that.rigidVars.contains(tv) then this.myRigidVars += tv
229+
if that.hardVars.contains(tv) then this.myHardVars += tv
230230
( (otherLos eq constraint.lower(p)) || otherLos.forall(_ <:< p)) &&
231231
( (otherHis eq constraint.upper(p)) || otherHis.forall(p <:< _)) &&
232232
((otherEntry eq constraint.entry(p)) || otherEntry.match

compiler/src/dotty/tools/dotc/core/Types.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4576,7 +4576,7 @@ object Types {
45764576
instantiateWith(tp)
45774577

45784578
def widenUnions(using Context) =
4579-
!ctx.typerState.rigidVars.contains(this)
4579+
!ctx.typerState.hardVars.contains(this)
45804580

45814581
/** For uninstantiated type variables: the entry in the constraint (either bounds or
45824582
* provisional instance value)

0 commit comments

Comments
 (0)