File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -6967,15 +6967,11 @@ object Types extends TypeUtils {
69676967 end NamedPartsAccumulator
69686968
69696969 class isGroundAccumulator (using Context ) extends TypeAccumulator [Boolean ] {
6970- var tparams = util.HashSet [TypeLambda ](initialCapacity = 8 )
69716970 def apply (x : Boolean , tp : Type ): Boolean = x && {
69726971 tp match {
6973- case tp : TypeParamRef => tparams.contains(tp.binder)
6972+ case _ : TypeParamRef => false
69746973 case tp : TypeVar => apply(x, tp.underlying)
69756974 case tp : AppliedType => tp.isGround(this )
6976- case tp : HKTypeLambda =>
6977- tparams.add(tp)
6978- apply(x, tp.resType)
69796975 case _ => foldOver(x, tp)
69806976 }
69816977 }
Original file line number Diff line number Diff line change @@ -4358,7 +4358,12 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
43584358 implicitArgs(formals2, argIndex + 1 , pt)
43594359
43604360 val pt1 = pt.deepenProtoTrans
4361- if (pt1 `ne` pt) && (pt1 ne sharpenedPt) && pt1.isGround then
4361+ val approxPt = withMode(Mode .TypevarsMissContext ):
4362+ wildApprox(pt1)
4363+ if (pt1 `ne` pt)
4364+ && (pt1 ne sharpenedPt)
4365+ && (AvoidWildcardsMap ()(approxPt) `eq` approxPt)
4366+ && ! isFullyDefined(formal, ForceDegree .none) then
43624367 constrainResult(tree.symbol, wtp, pt1)
43634368 val arg = inferImplicitArg(formal, tree.span.endPos)
43644369
You can’t perform that action at this time.
0 commit comments