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, };