We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 54ab00e commit e517975Copy full SHA for e517975
compiler/src/dotty/tools/dotc/core/TypeApplications.scala
@@ -455,7 +455,10 @@ class TypeApplications(val self: Type) extends AnyVal {
455
self.derivedExprType(tp.translateParameterized(from, to))
456
case _ =>
457
if (self.derivesFrom(from)) {
458
- val arg = self.baseType(from).argInfos.head
+ 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)
462
val arg1 = if (wildcardArg) TypeBounds.upper(arg) else arg
463
to.typeRef.appliedTo(arg1)
464
}
0 commit comments