@@ -5856,7 +5856,7 @@ object Types {
5856
5856
tp.derivedAppliedType(tycon, args.map(rangeToBounds)) match
5857
5857
case tp1 : AppliedType if tp1.isUnreducibleWild =>
5858
5858
// don't infer a type that would trigger an error later in
5859
- // Checling .checkAppliedType; fall through to default handling instead
5859
+ // Checking .checkAppliedType; fall through to default handling instead
5860
5860
case tp1 =>
5861
5861
return tp1
5862
5862
end if
@@ -5865,7 +5865,7 @@ object Types {
5865
5865
// non-range arguments L1, ..., Ln and H1, ..., Hn such that
5866
5866
// C[L1, ..., Ln] <: C[H1, ..., Hn] by taking the right limits of
5867
5867
// ranges that appear in as co- or contravariant arguments.
5868
- // Fail for non-variant argument ranges.
5868
+ // Fail for non-variant argument ranges (see use-site else branch below) .
5869
5869
// If successful, the L-arguments are in loBut, the H-arguments in hiBuf.
5870
5870
// @return operation succeeded for all arguments.
5871
5871
def distributeArgs (args : List [Type ], tparams : List [ParamInfo ]): Boolean = args match {
@@ -5886,8 +5886,11 @@ object Types {
5886
5886
if (distributeArgs(args, tp.tyconTypeParams))
5887
5887
range(tp.derivedAppliedType(tycon, loBuf.toList),
5888
5888
tp.derivedAppliedType(tycon, hiBuf.toList))
5889
- else range(defn.NothingType , defn.AnyType )
5890
- // TODO: can we give a better bound than `topType`?
5889
+ else if tycon.isLambdaSub then
5890
+ range(defn.NothingType , defn.AnyType )
5891
+ else
5892
+ // See lampepfl/dotty#14152
5893
+ range(defn.NothingType , tp.derivedAppliedType(tycon, args.map(rangeToBounds)))
5891
5894
else tp.derivedAppliedType(tycon, args)
5892
5895
}
5893
5896
0 commit comments