Skip to content

Commit 9b486f8

Browse files
Devirtualize Type.exists
1 parent 8a68d6f commit 9b486f8

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
@@ -134,7 +134,7 @@ object Types {
134134
}
135135

136136
/** Is this type different from NoType? */
137-
def exists: Boolean = true
137+
final def exists: Boolean = this.ne(NoType)
138138

139139
/** This type, if it exists, otherwise `that` type */
140140
def orElse(that: => Type) = if (exists) this else that
@@ -3734,7 +3734,6 @@ object Types {
37343734

37353735
/** Sentinel for "missing type" */
37363736
@sharable case object NoType extends CachedGroundType {
3737-
override def exists = false
37383737
override def computeHash(bs: Binders) = hashSeed
37393738
}
37403739

0 commit comments

Comments
 (0)