Skip to content

Commit 8fc6356

Browse files
committed
Correct erasure for Labeled blocks of type Unit.
1 parent ac5ea5a commit 8fc6356

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ object TypeErasure {
178178
if (defn.isPolymorphicAfterErasure(sym)) eraseParamBounds(sym.info.asInstanceOf[PolyType])
179179
else if (sym.isAbstractType) TypeAlias(WildcardType)
180180
else if (sym.isConstructor) outer.addParam(sym.owner.asClass, erase(tp)(erasureCtx))
181+
else if (sym.is(Label, butNot = Method)) erase.eraseResult(sym.info)(erasureCtx)
181182
else erase.eraseInfo(tp, sym)(erasureCtx) match {
182183
case einfo: MethodType =>
183184
if (sym.isGetter && einfo.resultType.isRef(defn.UnitClass))

0 commit comments

Comments
 (0)