aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/TypeOps.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotty/tools/dotc/core/TypeOps.scala')
-rw-r--r--src/dotty/tools/dotc/core/TypeOps.scala8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/core/TypeOps.scala b/src/dotty/tools/dotc/core/TypeOps.scala
index a0cc00b4b..8b4952489 100644
--- a/src/dotty/tools/dotc/core/TypeOps.scala
+++ b/src/dotty/tools/dotc/core/TypeOps.scala
@@ -48,9 +48,11 @@ trait TypeOps { this: Context =>
}
def instParam(ps: List[Symbol], as: List[Type]): Type =
- if (ps.isEmpty || as.isEmpty) throwError
- else if (tparam eq ps.head) as.head
- else throwError
+ if (as.isEmpty) tp
+ else if (ps.isEmpty) throwError
+ else if (tparam eq ps.head)
+ if (as.head.exists) as.head else tp
+ else instParam(ps.tail, as.tail)
if (tparamOwner == clazz && prefixMatches) instParamFrom(basePre)
else toInstance(basePre.normalizedPrefix, clazz.owner, tparam)