File tree 2 files changed +15
-2
lines changed
compiler/src/dotty/tools/dotc/core
tests/pos-custom-args/captures
2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -5948,8 +5948,6 @@ object Types {
5948
5948
if (distributeArgs(args, tp.tyconTypeParams))
5949
5949
range(tp.derivedAppliedType(tycon, loBuf.toList),
5950
5950
tp.derivedAppliedType(tycon, hiBuf.toList))
5951
- else if tycon.isLambdaSub || args.exists(isRangeOfNonTermTypes) then
5952
- range(defn.NothingType , defn.AnyType )
5953
5951
else if ctx.phase == Phases .checkCapturesPhase && args.forall(differsOnlyInCaptureSet) then
5954
5952
// This is a stopgap to avoid approximating the core type to Nothing. It can probably be
5955
5953
// dropped once we capture set ranges that we can keep as inference results.
@@ -5968,6 +5966,8 @@ object Types {
5968
5966
// We don't have that abstraction yet, so for now we approximate by the bounds, which
5969
5967
// avoids the failures, even though its soundness status is currently unclear.
5970
5968
tp.derivedAppliedType(tycon, args.map(rangeToBounds))
5969
+ else if tycon.isLambdaSub || args.exists(isRangeOfNonTermTypes) then
5970
+ range(defn.NothingType , defn.AnyType )
5971
5971
else
5972
5972
// See lampepfl/dotty#14152
5973
5973
range(defn.NothingType , tp.derivedAppliedType(tycon, args.map(rangeToBounds)))
Original file line number Diff line number Diff line change
1
+ class Name
2
+ class TermName extends Name
3
+ class TypeName extends Name
4
+
5
+ trait ParamInfo :
6
+ type ThisName <: Name
7
+ def variance : Long
8
+ object ParamInfo :
9
+ type Of [N <: Name ] = ParamInfo { type ThisName = N }
10
+
11
+ def test (tparams1 : List [ParamInfo { type ThisName = TypeName }], tparams2 : List [ParamInfo .Of [TypeName ]]) =
12
+ tparams1.lazyZip(tparams2).map((p1, p2) => p1.variance + p2.variance)
13
+
You can’t perform that action at this time.
0 commit comments