diff --git a/compiler/src/dotty/tools/dotc/core/TypeApplications.scala b/compiler/src/dotty/tools/dotc/core/TypeApplications.scala index 45c5ce8586bc..85c24a7dbe10 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeApplications.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeApplications.scala @@ -129,6 +129,8 @@ object TypeApplications { def apply(t: Type): Type = t match { case t @ AppliedType(tycon, args1) if tycon.typeSymbol.isClass => t.derivedAppliedType(apply(tycon), args1.mapConserve(applyArg)) + case t @ RefinedType(parent, name, TypeAlias(info)) => + t.derivedRefinedType(apply(parent), name, applyArg(info).bounds) case p: TypeParamRef if p.binder == tycon => args(p.paramNum) match { case TypeBounds(lo, hi) => diff --git a/tests/pos/hkRefAlias.scala b/tests/pos/hkRefAlias.scala new file mode 100644 index 000000000000..58ec787def1c --- /dev/null +++ b/tests/pos/hkRefAlias.scala @@ -0,0 +1,10 @@ +class Bar +class X +class Y extends X + +object Test { + type G[X] = Bar { type R = X } + + implicitly[G[_] =:= (Bar { type R })] + implicitly[G[_ >: Y <: X] =:= (Bar { type R >: Y <: X })] +}