Skip to content

Commit 1161dc0

Browse files
committed
Review fixes
1 parent 2e2558f commit 1161dc0

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -190,12 +190,8 @@ object Checking {
190190
case tref: TypeRef =>
191191
val cls = tref.symbol
192192
if (cls.isOneOf(AbstractOrTrait)) {
193-
srcTp.underlyingClassRef(refinementOK = false) match
194-
case tref0: TypeRef =>
195-
val srcCls = tref0.symbol
196-
report.error(CantInstantiateAbstractClassOrTrait(srcCls, isTrait = srcCls.is(Trait)), pos)
197-
case _ =>
198-
report.error(CantInstantiateAbstractClassOrTrait(cls, isTrait = cls.is(Trait)), pos)
193+
val srcCls = srcTp.underlyingClassRef(refinementOK = false).typeSymbol
194+
report.error(CantInstantiateAbstractClassOrTrait(srcCls, isTrait = srcCls.is(Trait)), pos)
199195
}
200196
if !cls.is(Module) then
201197
// Create a synthetic singleton type instance, and check whether

0 commit comments

Comments
 (0)