[m-rev.] for post-commit review: add comments to typecheck_coerce.m
Peter Wang
novalazy at gmail.com
Mon Jul 27 12:02:58 AEST 2026
On Mon, 27 Jul 2026 02:55:01 +0200 "Zoltan Somogyi" <zoltan.somogyi at runbox.com> wrote:
>
>
> On Sat, 25 Jul 2026 15:37:34 +0200 (CEST), "Zoltan Somogyi" <zoltan.somogyi at runbox.com> wrote:
> > For review by Peter, mostly just of the new NOTE about
> > existentially typed args in data constructors.
>
> That note is:
>
> % NOTE If the base type_ctor has arity zero (meaning it has no parameters),
> % we could shortcut this and just return an empty set as InvariantTVars,
> % IF we knew that none of its data constructors had existentially
> % typed arguments. This is because the InvariantTVars we return
> % are guaranteed to be a subset of the type_ctor's type parameters,
> % EXCEPT in the presence of such arguments.
>
> I have since realized that the presence or absence of existentially quantified
> type vars in InvariantTVars does not matter, because the only thing we use
> InvariantTVars for is to test whether a given type parameter is in that set.
> So the small optimization describe above should work. I will add it after my
> latest diff is reviewed/committed.
That's right. The rest of the diff is fine.
Peter
More information about the reviews
mailing list