aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--boot/type_check.cc10
-rw-r--r--include/elna/boot/type_check.h2
-rw-r--r--testsuite/compilable/block_variables.elna8
3 files changed, 20 insertions, 0 deletions
diff --git a/boot/type_check.cc b/boot/type_check.cc
index d8a9170..31e10f1 100644
--- a/boot/type_check.cc
+++ b/boot/type_check.cc
@@ -1506,6 +1506,16 @@ namespace elna::boot
}
// else callable is not declared, or inference failed and reported.
}
+
+ void type_analysis_visitor::visit(defer_statement *statement)
+ {
+ traverse_block(statement->body);
+ }
+
+ void type_analysis_visitor::visit(block_statement *statement)
+ {
+ traverse_block(statement->body);
+ }
void type_analysis_visitor::visit(record_constructor_expression *expression)
{
diff --git a/include/elna/boot/type_check.h b/include/elna/boot/type_check.h
index 5a2d7f1..d9a07b9 100644
--- a/include/elna/boot/type_check.h
+++ b/include/elna/boot/type_check.h
@@ -317,6 +317,8 @@ namespace elna::boot
void visit(repeat_statement *statement) override;
void visit(while_statement *statement) override;
void visit(if_statement *statement) override;
+ void visit(defer_statement *statement) override;
+ void visit(block_statement *statement) override;
void visit(record_constructor_expression *expression) override;
void visit(array_constructor_expression *expression) override;
void visit(traits_expression *trait) override;
diff --git a/testsuite/compilable/block_variables.elna b/testsuite/compilable/block_variables.elna
new file mode 100644
index 0000000..c67e8b6
--- /dev/null
+++ b/testsuite/compilable/block_variables.elna
@@ -0,0 +1,8 @@
+program()
+
+begin
+ block b
+ var
+ x: Int
+ end
+end.