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 {
6967
6967
end NamedPartsAccumulator
6968
6968
6969
6969
class isGroundAccumulator (using Context ) extends TypeAccumulator [Boolean ] {
6970
- var tparams = util.HashSet [TypeLambda ](initialCapacity = 8 )
6971
6970
def apply (x : Boolean , tp : Type ): Boolean = x && {
6972
6971
tp match {
6973
- case tp : TypeParamRef => tparams.contains(tp.binder)
6972
+ case _ : TypeParamRef => false
6974
6973
case tp : TypeVar => apply(x, tp.underlying)
6975
6974
case tp : AppliedType => tp.isGround(this )
6976
- case tp : HKTypeLambda =>
6977
- tparams.add(tp)
6978
- apply(x, tp.resType)
6979
6975
case _ => foldOver(x, tp)
6980
6976
}
6981
6977
}
Original file line number Diff line number Diff line change @@ -4358,7 +4358,12 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
4358
4358
implicitArgs(formals2, argIndex + 1 , pt)
4359
4359
4360
4360
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
4362
4367
constrainResult(tree.symbol, wtp, pt1)
4363
4368
val arg = inferImplicitArg(formal, tree.span.endPos)
4364
4369
You can’t perform that action at this time.
0 commit comments