Skip to content

Commit af94114

Browse files
committed
Drop redundant check
`shapeWithClassType` does not return a NoType anymore.
1 parent 8e0f98b commit af94114

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

compiler/src/dotty/tools/dotc/typer/Deriving.scala

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -431,13 +431,9 @@ trait Deriving { this: Typer =>
431431
/** Synthesized instance for `Generic[<clsType>]` */
432432
def genericInstance(clsType: Type): tpd.Tree = {
433433
val shape = shapeOfType(clsType)
434-
if (shape.exists) {
435-
val genericType = RefinedType(defn.GenericType.appliedTo(clsType), tpnme.Shape, TypeAlias(shape))
436-
val finalizer = new Finalizer
437-
finalizer.genericRHS(genericType, finalizer.genericClassRHS)
438-
}
439-
else errorTree(tpd.EmptyTree.withPos(codePos),
440-
i"cannot take shape of type $clsType", codePos)
434+
val genericType = RefinedType(defn.GenericType.appliedTo(clsType), tpnme.Shape, TypeAlias(shape))
435+
val finalizer = new Finalizer
436+
finalizer.genericRHS(genericType, finalizer.genericClassRHS)
441437
}
442438
}
443439
}

0 commit comments

Comments
 (0)