File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -455,7 +455,10 @@ class TypeApplications(val self: Type) extends AnyVal {
455455 self.derivedExprType(tp.translateParameterized(from, to))
456456 case _ =>
457457 if (self.derivesFrom(from)) {
458- val arg = self.baseType(from).argInfos.head
458+ def elemType (tp : Type ): Type = tp match
459+ case tp : AndOrType => tp.derivedAndOrType(elemType(tp.tp1), elemType(tp.tp2))
460+ case _ => tp.baseType(from).argInfos.head
461+ val arg = elemType(self)
459462 val arg1 = if (wildcardArg) TypeBounds .upper(arg) else arg
460463 to.typeRef.appliedTo(arg1)
461464 }
Original file line number Diff line number Diff line change 1+ object O {
2+ def m (x : Any * ) = ()
3+ def n (l : List [Int ] | List [String ]): Unit = m(l : _* )
4+ def n2 (l : List [Int ] & List [String ]): Unit = m(l : _* )
5+ }
You can’t perform that action at this time.
0 commit comments