Skip to content

Commit f25a60f

Browse files
Devirtualize Type.exists
1 parent d6b9992 commit f25a60f

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
@@ -97,7 +97,7 @@ object Types {
9797
}
9898

9999
/** Is this type different from NoType? */
100-
def exists: Boolean = true
100+
final def exists: Boolean = !this.eq(NoType)
101101

102102
/** This type, if it exists, otherwise `that` type */
103103
def orElse(that: => Type) = if (exists) this else that
@@ -3741,7 +3741,6 @@ object Types {
37413741

37423742
/** Sentinel for "missing type" */
37433743
@sharable case object NoType extends CachedGroundType {
3744-
override def exists = false
37453744
override def computeHash(bs: Binders) = hashSeed
37463745
}
37473746

0 commit comments

Comments
 (0)