File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -198,10 +198,12 @@ object Inferencing {
198198 * - If we have A <: Int and F <: [A] => Option[A] (note the invariance),
199199 * then we should approximate F[A] ~~ Option[A]. That is, we should
200200 * respect the invariance of the type constructor.
201- * - If we have A <: Option[B] and B <: Int, we approximate A ~~ Option[Int].
202- * That is, we recursively approximate all nested GADT-constrained types.
203- * This is certain to be sound (because we maintain necessary subtyping),
204- * but not accurate.
201+ * - If we have A <: Option[B] and B <: Int, we approximate A ~~
202+ * Option[B]. That is, we don't recurse into already approximated
203+ * types. Since GADT approximation is (for now) only used for member
204+ * selection, this behaviour is expected, as nested types cannot affect
205+ * member selection (note that given/extension lookup doesn't need GADT
206+ * approx, see gadt-approximation-interaction.scala).
205207 */
206208 def apply (tp : Type ): Type = tp.dealias match {
207209 case tp @ TypeRef (qual, nme) if (qual eq NoPrefix )
You can’t perform that action at this time.
0 commit comments