Skip to content

Commit b406c66

Browse files
committed
Rename to isNothing
1 parent 2b52368 commit b406c66

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

compiler/src/dotty/tools/dotc/ast/tpd.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
586586
val tree2: Select = tree.tpe match {
587587
case tpe: NamedType =>
588588
val qualType = qualifier.tpe.widenIfUnstable
589-
if qualType.isNothingType then tree1.withTypeUnchecked(tree.tpe)
589+
if qualType.isNothing then tree1.withTypeUnchecked(tree.tpe)
590590
else tree1.withType(tpe.derivedSelect(qualType))
591591
case _ => tree1.withTypeUnchecked(tree.tpe)
592592
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2325,7 +2325,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
23252325
*/
23262326
def provablyEmpty(tp: Type): Boolean =
23272327
tp.dealias match {
2328-
case tp if tp.isNothingType => true
2328+
case tp if tp.isNothing => true
23292329
case AndType(tp1, tp2) => provablyDisjoint(tp1, tp2)
23302330
case OrType(tp1, tp2) => provablyEmpty(tp1) && provablyEmpty(tp2)
23312331
case at @ AppliedType(tycon, args) =>

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ object Types {
266266
}
267267

268268
/** Is this type exactly Nothing (no vars, aliases, refinements etc allowed)? */
269-
def isNothingType(using Context): Boolean = this match {
269+
def isNothing(using Context): Boolean = this match {
270270
case tp: TypeRef =>
271271
tp.name == tpnme.Nothing && (tp.symbol eq defn.NothingClass)
272272
case _ => false
@@ -2126,7 +2126,7 @@ object Types {
21262126
case arg: TypeBounds =>
21272127
val v = param.paramVarianceSign
21282128
val pbounds = param.paramInfo
2129-
if (v > 0 && pbounds.loBound.dealiasKeepAnnots.isNothingType) TypeAlias(arg.hiBound & rebase(pbounds.hiBound))
2129+
if (v > 0 && pbounds.loBound.dealiasKeepAnnots.isNothing) TypeAlias(arg.hiBound & rebase(pbounds.hiBound))
21302130
else if (v < 0 && pbounds.hiBound.dealiasKeepAnnots.isTopType) TypeAlias(arg.loBound | rebase(pbounds.loBound))
21312131
else arg recoverable_& rebase(pbounds)
21322132
case arg => TypeAlias(arg)
@@ -2289,7 +2289,7 @@ object Types {
22892289
if (base.isAnd == variance >= 0) tp1 & tp2 else tp1 | tp2
22902290
case _ =>
22912291
if (pre.termSymbol.is(Package)) argForParam(pre.select(nme.PACKAGE))
2292-
else if (pre.isNothingType) pre
2292+
else if (pre.isNothing) pre
22932293
else NoType
22942294
}
22952295
}
@@ -2308,7 +2308,7 @@ object Types {
23082308
*/
23092309
def derivedSelect(prefix: Type)(using Context): Type =
23102310
if (prefix eq this.prefix) this
2311-
else if (prefix.isNothingType) prefix
2311+
else if (prefix.isNothing) prefix
23122312
else {
23132313
if (isType) {
23142314
val res =
@@ -4292,7 +4292,7 @@ object Types {
42924292

42934293
/** For uninstantiated type variables: Is the lower bound different from Nothing? */
42944294
def hasLowerBound(using Context): Boolean =
4295-
!ctx.typerState.constraint.entry(origin).loBound.isNothingType
4295+
!ctx.typerState.constraint.entry(origin).loBound.isNothing
42964296

42974297
/** For uninstantiated type variables: Is the upper bound different from Any? */
42984298
def hasUpperBound(using Context): Boolean =
@@ -5297,7 +5297,7 @@ object Types {
52975297
case _ =>
52985298
def propagate(lo: Type, hi: Type) =
52995299
range(derivedRefinedType(tp, parent, lo), derivedRefinedType(tp, parent, hi))
5300-
if (parent.isNothingType) parent
5300+
if (parent.isNothing) parent
53015301
else info match {
53025302
case Range(infoLo: TypeBounds, infoHi: TypeBounds) =>
53035303
assert(variance == 0)
@@ -5390,7 +5390,7 @@ object Types {
53905390
case Range(lo, hi) =>
53915391
range(tp.derivedAnnotatedType(lo, annot), tp.derivedAnnotatedType(hi, annot))
53925392
case _ =>
5393-
if (underlying.isNothingType) underlying
5393+
if (underlying.isNothing) underlying
53945394
else tp.derivedAnnotatedType(underlying, annot)
53955395
}
53965396
override protected def derivedWildcardType(tp: WildcardType, bounds: Type): WildcardType =
@@ -5638,7 +5638,7 @@ object Types {
56385638
else {
56395639
seen += tp
56405640
tp match {
5641-
case tp if tp.isTopType || tp.isNothingType =>
5641+
case tp if tp.isTopType || tp.isNothing =>
56425642
cs
56435643
case tp: AppliedType =>
56445644
foldOver(cs + tp.typeSymbol, tp)

compiler/src/dotty/tools/dotc/interactive/Completion.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ object Completion {
205205
* considered.
206206
*/
207207
def addMemberCompletions(qual: Tree)(using Context): Unit =
208-
if (!qual.tpe.widenDealias.isNothingType) {
208+
if (!qual.tpe.widenDealias.isNothing) {
209209
addAccessibleMembers(qual.tpe)
210210
if (!mode.is(Mode.Import) && !qual.tpe.isNullType)
211211
// Implicit conversions do not kick in when importing

compiler/src/dotty/tools/dotc/typer/ErrorReporting.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ object ErrorReporting {
169169
|Note that `${tree.name}` is treated as an infix operator in Scala 3.
170170
|If you do not want that, insert a `;` or empty line in front
171171
|or drop any spaces behind the operator."""
172-
else if qualType.isNothingType then
172+
else if qualType.isNothing then
173173
""
174174
else
175175
val add = suggestImports(

0 commit comments

Comments
 (0)