From 5c0507731298607092d6dfe5bc1fff932c57f27c Mon Sep 17 00:00:00 2001 From: John Doty Date: Tue, 9 Jan 2024 09:22:48 -0800 Subject: [PATCH] [fine] a note about a latent bug --- fine/src/semantics.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/fine/src/semantics.rs b/fine/src/semantics.rs index 03746659..77de0afa 100644 --- a/fine/src/semantics.rs +++ b/fine/src/semantics.rs @@ -401,6 +401,22 @@ impl<'a> Semantics<'a> { TreeKind::LetStatement => self.environment_of_let(parent, tree), TreeKind::FunctionDecl => self.environment_of_func(parent, tree), + // TODO: Blocks should introduce a local environment if required. + // Test with a type error in a block statement and a + // binding outside. You will need a new assertion type and + // possibly a compile/run to ensure it works. + // + // let x = 7; + // { + // let x = 23; + // } + // print(x); // 7 + // + // { + // let y = 12; // check: `y` is local not global! + // } + // print(y); // error, cannot find 'y' + // TODO: MORE Things that introduce an environment! _ => parent, };