Skip to content

Commit f6e724b

Browse files
Devirtualize Type.exists
1 parent a8ad133 commit f6e724b

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
@@ -3709,7 +3709,6 @@ object Types {
37093709

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

0 commit comments

Comments
 (0)