Skip to content

Commit 2fa72ba

Browse files
Devirtualize Type.exists
1 parent 9775736 commit 2fa72ba

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ object Types {
132132
}
133133

134134
/** Is this type different from NoType? */
135-
def exists: Boolean = true
135+
final def exists: Boolean = !this.eq(NoType)
136136

137137
/** This type, if it exists, otherwise `that` type */
138138
def orElse(that: => Type) = if (exists) this else that
@@ -3708,7 +3708,6 @@ object Types {
37083708

37093709
/** Sentinel for "missing type" */
37103710
@sharable case object NoType extends CachedGroundType {
3711-
override def exists = false
37123711
override def computeHash(bs: Binders) = hashSeed
37133712
}
37143713

0 commit comments

Comments
 (0)