@@ -168,7 +168,12 @@ class TypeComparer(initctx: Context) extends ConstraintHandling[AbsentContext] {
168
168
* one should use `isSubType(_, _)`.
169
169
* `recur` should also not be used to compare approximated versions of the original
170
170
* types (as when we go from an abstract type to one of its bounds). In that case
171
- * one should use `isSubType(_, _, a)` where `a` defines the kind of approximation
171
+ * one should use `isSubType(_, _, a)` where `a` defines the kind of approximation.
172
+ *
173
+ * Note: Logicaly, `recur` could be nested in `isSubType`, which would avoid
174
+ * the instance state consisting `approx` and `leftRoot`. But then the implemented
175
+ * code would have two extra parameters for each of the many calls that go from
176
+ * one sub-part of isSubType to another.
172
177
*/
173
178
protected def recur (tp1 : Type , tp2 : Type ): Boolean = trace(s " isSubType ${traceInfo(tp1, tp2)} $approx" , subtyping) {
174
179
@@ -1063,6 +1068,12 @@ class TypeComparer(initctx: Context) extends ConstraintHandling[AbsentContext] {
1063
1068
* type of a synthesized tree before comparing it with an expected type.
1064
1069
* But no such adaptation is applied for implicit eligibility
1065
1070
* testing, so we have to compensate.
1071
+ *
1072
+ * Note: Doing the capture conversion on path types is actually not necessary
1073
+ * since we can already deal with the situation through skolemization in Typer#captureWildcards.
1074
+ * But performance tests indicate that it's better to do it, since we avoid
1075
+ * skolemizations, which are more expensive . And, besides, capture conversion on
1076
+ * paths is less intrusive than skolemization.
1066
1077
*/
1067
1078
def compareCaptured (arg1 : TypeBounds , arg2 : Type ) = tparam match {
1068
1079
case tparam : Symbol
0 commit comments