Skip to content

Commit bb7c2da

Browse files
Devirtualize Type.exists
1 parent c9189c2 commit bb7c2da

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
@@ -3766,7 +3766,6 @@ object Types {
37663766

37673767
/** Sentinel for "missing type" */
37683768
@sharable case object NoType extends CachedGroundType {
3769-
override def exists = false
37703769
override def computeHash(bs: Binders) = hashSeed
37713770
}
37723771

0 commit comments

Comments
 (0)