File tree Expand file tree Collapse file tree 1 file changed +3
-11
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -1439,18 +1439,10 @@ class Namer { typer: Typer =>
14391439 // instead of widening to the underlying module class types.
14401440 // We also drop the @Repeated annotation here to avoid leaking it in method result types
14411441 // (see run/inferred-repeated-result).
1442- def widenRhs (tp : Type ): Type = {
1443- val tp1 = tp.widenTermRefExpr.simplified match
1442+ def widenRhs (tp : Type ): Type =
1443+ tp.widenTermRefExpr.simplified match
14441444 case ctp : ConstantType if isInlineVal => ctp
1445- case ref : TypeRef if ref.symbol.is(ModuleClass ) => tp
1446- case tp =>
1447- if true then ctx.typeComparer.widenInferred(tp, rhsProto)
1448- else rhsProto match {
1449- case OrType (_, _) | WildcardType (TypeBounds (_, OrType (_, _))) => tp.widen
1450- case _ => tp.widenUnion
1451- }
1452- tp1.dropRepeatedAnnot
1453- }
1445+ case tp => ctx.typeComparer.widenInferred(tp, rhsProto)
14541446
14551447 // Replace aliases to Unit by Unit itself. If we leave the alias in
14561448 // it would be erased to BoxedUnit.
You can’t perform that action at this time.
0 commit comments