From 64c6b8896d063b5375397806ad3d1e5f8c3e5a71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Suzanne=20Dup=C3=A9ron?= Date: Wed, 3 Jun 2020 12:54:40 +0100 Subject: [PATCH] comment --- src/stages/typesystem/misc.ml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/stages/typesystem/misc.ml b/src/stages/typesystem/misc.ml index 070a502ff..da0bcdd50 100644 --- a/src/stages/typesystem/misc.ml +++ b/src/stages/typesystem/misc.ml @@ -231,8 +231,14 @@ module Substitution = struct let aux c = constraint_ ~c ~substs in let constraints = List.map aux p.constraints in if (Var.equal p.binder v) then ( + (* The variable v is shadowed by the forall's binder, so + we don't substitute inside the body. This should be + handled in a more elegant manner once we have a proper + environment and scopes. *) { tsrc = "?TODO3?" ; t = P_forall { p with constraints } } ) else ( + (* The variable v is still visible within the forall, so + substitute also within the body *) let body = self p.body in { tsrc = "?TODO4?" ; t = P_forall { p with constraints ; body } } )