From 6d5afc13f3b6212d7681a27bae9aa2dbcf389b44 Mon Sep 17 00:00:00 2001 From: Kristian Larsson Date: Wed, 9 Oct 2024 13:30:44 +0200 Subject: [PATCH] Allow naming overlap for hierarchical modules Having a module foo (src/foo.act) and a foo.bar (src/foo/bar.act) would previously "conflict" and lead to a compilation error. We now allow it. We should really have some more checks around this to ensure that there are no true conflicts, i.e. that the module foo does not define any "bar", since the foo.bar is now a module... but that's for later ;) Meanwhile, one needs to be careful :) --- compiler/Acton/Env.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/Acton/Env.hs b/compiler/Acton/Env.hs index 0c355df68..2d49f4066 100644 --- a/compiler/Acton/Env.hs +++ b/compiler/Acton/Env.hs @@ -435,7 +435,7 @@ addMod :: ModName -> TEnv -> EnvF x -> EnvF x addMod m newte env = env{ modules = addM ns (modules env) } where ModName ns = m - addM [] te = newte + addM [] te = newte ++ te addM (n:ns) te = update n ns te update n ns ((x,i):te) | n == x,