From 6798fb05a9410a20d17676b1449d2bcc5fd36594 Mon Sep 17 00:00:00 2001 From: Troels Henriksen Date: Fri, 25 Aug 2023 10:24:35 +0200 Subject: [PATCH] Fix #2011. --- src/Language/Futhark/Interpreter.hs | 4 +++- tests/issue2011.fut | 9 +++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 tests/issue2011.fut diff --git a/src/Language/Futhark/Interpreter.hs b/src/Language/Futhark/Interpreter.hs index f34979abdf..86fff8fb88 100644 --- a/src/Language/Futhark/Interpreter.hs +++ b/src/Language/Futhark/Interpreter.hs @@ -1152,7 +1152,9 @@ evalModExp env (ModDecs ds _) = do Env terms types <- foldM evalDec env ds -- Remove everything that was present in the original Env. pure - ( Env terms types, + ( Env + (terms `M.difference` envTerm env) + (types `M.difference` envType env), Module $ Env (terms `M.difference` envTerm env) diff --git a/tests/issue2011.fut b/tests/issue2011.fut new file mode 100644 index 0000000000..9dd9b70bf5 --- /dev/null +++ b/tests/issue2011.fut @@ -0,0 +1,9 @@ +-- == +-- input {} +-- output { 4u64 } + +module mod: {module x: integral} = { + module x = u64 +} + +def main = u64.i64 4