@@ -96,7 +96,8 @@ trait TypeAssigner {
96
96
}
97
97
case tp @ AppliedType (tycon, args) if toAvoid(tycon) =>
98
98
val base = apply(tycon)
99
- apply(base.appliedTo(tp.baseArgInfos(base.typeSymbol)))
99
+ val args = tp.baseArgInfos(base.typeSymbol)
100
+ if (base.typeParams.length == args.length) base.appliedTo(args) else base
100
101
case tp @ RefinedType (parent, name) if variance > 0 =>
101
102
val parent1 = apply(tp.parent)
102
103
val refinedInfo1 = apply(tp.refinedInfo)
@@ -404,16 +405,13 @@ trait TypeAssigner {
404
405
405
406
def assignType (tree : untpd.AppliedTypeTree , tycon : Tree , args : List [Tree ])(implicit ctx : Context ) = {
406
407
val tparams = tycon.tpe.typeParams
408
+ lazy val ntparams = tycon.tpe.namedTypeParams
407
409
def refineNamed (tycon : Type , arg : Tree ) = arg match {
408
410
case ast.Trees .NamedArg (name, argtpt) =>
409
411
// Dotty deviation: importing ast.Trees._ and matching on NamedArg gives a cyclic ref error
410
412
val tparam = tparams.find(_.name == name) match {
411
413
case Some (tparam) => tparam
412
- case none =>
413
- val sym = tycon.member(name).symbol
414
- if (sym.isAbstractType) sym
415
- else if (sym.is(ParamAccessor )) sym.info.dealias.typeSymbol
416
- else NoSymbol
414
+ case none => ntparams.find(_.name == name).getOrElse(NoSymbol )
417
415
}
418
416
if (tparam.exists) RefinedType (tycon, name, argtpt.tpe.toBounds(tparam))
419
417
else errorType(i " $tycon does not have a parameter or abstract type member named $name" , arg.pos)
0 commit comments