aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/TypeApplications.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotty/tools/dotc/core/TypeApplications.scala')
-rw-r--r--src/dotty/tools/dotc/core/TypeApplications.scala12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/core/TypeApplications.scala b/src/dotty/tools/dotc/core/TypeApplications.scala
index dfd1caf62..c270288b2 100644
--- a/src/dotty/tools/dotc/core/TypeApplications.scala
+++ b/src/dotty/tools/dotc/core/TypeApplications.scala
@@ -236,9 +236,15 @@ object TypeApplications {
/** Adapt all arguments to possible higher-kinded type parameters using etaExpandIfHK
*/
- def etaExpandIfHK(tparams: List[Symbol], args: List[Type])(implicit ctx: Context): List[Type] =
+ def etaExpandIfHK(tparams: List[MemberBinding], args: List[Type])(implicit ctx: Context): List[Type] =
if (tparams.isEmpty) args
- else args.zipWithConserve(tparams)((arg, tparam) => arg.etaExpandIfHK(tparam.infoOrCompleter))
+ else {
+ def bounds(tparam: MemberBinding) = tparam match {
+ case tparam: Symbol => tparam.infoOrCompleter
+ case tparam: RefinedType => tparam.memberBounds
+ }
+ args.zipWithConserve(tparams)((arg, tparam) => arg.etaExpandIfHK(bounds(tparam)))
+ }
/** The references `<rt>.this.$hk0, ..., <rt>.this.$hk<n-1>`. */
def argRefs(rt: RefinedType, n: Int)(implicit ctx: Context) =
@@ -374,7 +380,7 @@ class TypeApplications(val self: Type) extends AnyVal {
final def typeParamSymbols(implicit ctx: Context): List[TypeSymbol] = {
val tparams = typeParams
- assert(tparams.isEmpty || tparams.head.isInstanceOf[Symbol])
+ assert(tparams.isEmpty || tparams.head.isInstanceOf[Symbol], self)
tparams.asInstanceOf[List[TypeSymbol]]
}