File tree 2 files changed +6
-1
lines changed
src/dotty/tools/dotc/core
2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -162,7 +162,8 @@ trait ConstraintHandling {
162
162
/** Solve constraint set for given type parameter `param`.
163
163
* If `fromBelow` is true the parameter is approximated by its lower bound,
164
164
* otherwise it is approximated by its upper bound. However, any occurrences
165
- * of the parameter in a refinement somewhere in the bound are removed.
165
+ * of the parameter in a refinement somewhere in the bound are removed. Also
166
+ * wildcard types in bounds are approximated by their upper or lower bounds.
166
167
* (Such occurrences can arise for F-bounded types).
167
168
* The constraint is left unchanged.
168
169
* @return the instantiating type
@@ -174,6 +175,9 @@ trait ConstraintHandling {
174
175
def apply (tp : Type ) = mapOver {
175
176
tp match {
176
177
case tp : RefinedType if param occursIn tp.refinedInfo => tp.parent
178
+ case tp : WildcardType =>
179
+ val bounds = tp.optBounds.orElse(TypeBounds .empty).bounds
180
+ if (fromBelow == (variance >= 0 )) bounds.lo else bounds.hi
177
181
case _ => tp
178
182
}
179
183
}
Original file line number Diff line number Diff line change
1
+ case class W [T ](seq : Option [Option [T ]] = Option .empty)
You can’t perform that action at this time.
0 commit comments