File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
src/dotty/tools/dotc/core Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -162,7 +162,8 @@ trait ConstraintHandling {
162162 /** Solve constraint set for given type parameter `param`.
163163 * If `fromBelow` is true the parameter is approximated by its lower bound,
164164 * 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.
166167 * (Such occurrences can arise for F-bounded types).
167168 * The constraint is left unchanged.
168169 * @return the instantiating type
@@ -174,6 +175,9 @@ trait ConstraintHandling {
174175 def apply (tp : Type ) = mapOver {
175176 tp match {
176177 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
177181 case _ => tp
178182 }
179183 }
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