Skip to content

Commit 1928318

Browse files
committed
Fix unpickling of type aliases
1 parent bf0d185 commit 1928318

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -347,10 +347,13 @@ class TreeUnpickler(reader: TastyReader,
347347
readType().appliedTo(until(end)(readType()))
348348
case TYPEBOUNDS =>
349349
val lo = readType()
350-
val hi = if nothingButMods(end) then lo else readType()
351-
val variantHi = readVariances(hi)
352-
if (lo.isMatch && (lo `eq` hi)) MatchAlias(variantHi)
353-
else TypeBounds(lo, variantHi)
350+
if nothingButMods(end) then
351+
TypeAlias(readVariances(lo))
352+
else
353+
val hi = readType()
354+
val variantHi = readVariances(hi)
355+
if (lo.isMatch && (lo `eq` hi)) MatchAlias(variantHi)
356+
else TypeBounds(lo, variantHi)
354357
case ANNOTATEDtype =>
355358
AnnotatedType(readType(), Annotation(readTerm()))
356359
case ANDtype =>

0 commit comments

Comments
 (0)