Skip to content

Commit 0e5b505

Browse files
Devirtualize Type.exists
1 parent 798e57e commit 0e5b505

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.ne(NoType)
136136

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

37653765
/** Sentinel for "missing type" */
37663766
@sharable case object NoType extends CachedGroundType {
3767-
override def exists = false
37683767
override def computeHash(bs: Binders) = hashSeed
37693768
}
37703769

0 commit comments

Comments
 (0)