Skip to content

Commit fc279f0

Browse files
Devirtualize Type.exists
1 parent c16ed30 commit fc279f0

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
@@ -3712,7 +3712,6 @@ object Types {
37123712

37133713
/** Sentinel for "missing type" */
37143714
@sharable case object NoType extends CachedGroundType {
3715-
override def exists = false
37163715
override def computeHash(bs: Binders) = hashSeed
37173716
}
37183717

0 commit comments

Comments
 (0)