Skip to content

Commit a048e50

Browse files
committed
Fix docs
and eliminate redundant case in isCovered.
1 parent 4977571 commit a048e50

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

compiler/src/dotty/tools/dotc/core/TypeComparer.scala

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -983,14 +983,10 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
983983

984984
/** A type has been covered previously in subtype checking if it
985985
* is some combination of TypeRefs that point to classes, where the
986-
* combiners are RefinedTypes, RecTypes, AndTypes or AnnotatedTypes.
987-
* One exception: Refinements referring to basetype args are never considered
988-
* to be already covered. This is necessary because such refined types might
989-
* still need to be compared with a compareAliasRefined.
986+
* combiners are RefinedTypes, RecTypes, And/Or-Types or AnnotatedTypes.
990987
*/
991-
private def isCovered(tp: Type): Boolean = tp.dealias.stripTypeVar match {
988+
private def isCovered(tp: Type): Boolean = tp.dealias.stripTypeVar match {
992989
case tp: TypeRef => tp.symbol.isClass && tp.symbol != NothingClass && tp.symbol != NullClass
993-
case tp: ProtoType => false
994990
case tp: RefinedOrRecType => isCovered(tp.parent)
995991
case tp: AnnotatedType => isCovered(tp.underlying)
996992
case tp: AndOrType => isCovered(tp.tp1) && isCovered(tp.tp2)

0 commit comments

Comments
 (0)