File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -2891,6 +2891,7 @@ object Types {
2891
2891
else apply(tp1, tp2)
2892
2892
}
2893
2893
2894
+ /** An extractor for `T | Null` or `Null | T`, returning the `T` */
2894
2895
object OrNull with
2895
2896
private def stripNull (tp : Type )(given Context ): Type = tp match
2896
2897
case tp @ OrType (tp1, tp2) =>
Original file line number Diff line number Diff line change @@ -1347,11 +1347,10 @@ class Namer { typer: Typer =>
1347
1347
// We also drop the @Repeated annotation here to avoid leaking it in method result types
1348
1348
// (see run/inferred-repeated-result).
1349
1349
def widenRhs (tp : Type ): Type = {
1350
- val tp1 = tp.widenTermRefExpr match {
1350
+ val tp1 = tp.widenTermRefExpr.simplified match
1351
1351
case ctp : ConstantType if isInlineVal => ctp
1352
1352
case ref : TypeRef if ref.symbol.is(ModuleClass ) => tp
1353
- case _ => tp.widenUnion
1354
- }
1353
+ case tp => tp.widenUnion
1355
1354
tp1.dropRepeatedAnnot
1356
1355
}
1357
1356
You can’t perform that action at this time.
0 commit comments