File tree 1 file changed +11
-3
lines changed
src/dotty/tools/dotc/core
1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -70,10 +70,18 @@ object TypeApplications {
70
70
}
71
71
72
72
def unapply (tp : Type )(implicit ctx : Context ): Option [(List [Int ], List [TypeBounds ], Type )] = tp match {
73
- case app @ RefinedType (prefix , tpnme.hkApply) =>
74
- val cls = prefix .typeSymbol
73
+ case app @ RefinedType (parent , tpnme.hkApply) =>
74
+ val cls = parent .typeSymbol
75
75
val variances = cls.typeParams.map(_.variance)
76
- val argBounds = prefix.argInfos.map(_.bounds)
76
+ def collectBounds (t : Type , acc : List [TypeBounds ]): List [TypeBounds ] = t match {
77
+ case t @ RefinedType (p, rname) =>
78
+ assert(rname.isHkArgName)
79
+ collectBounds(p, t.refinedInfo.bounds :: acc)
80
+ case TypeRef (_, lname) =>
81
+ assert(lname.isLambdaTraitName)
82
+ acc
83
+ }
84
+ val argBounds = collectBounds(parent, Nil )
77
85
Some ((variances, argBounds, app.refinedInfo.argInfo))
78
86
case _ =>
79
87
None
You can’t perform that action at this time.
0 commit comments