diff --git a/source/modules/soul_core/compiler/soul_SanityCheckPass.h b/source/modules/soul_core/compiler/soul_SanityCheckPass.h index eca23be..fa10ad2 100644 --- a/source/modules/soul_core/compiler/soul_SanityCheckPass.h +++ b/source/modules/soul_core/compiler/soul_SanityCheckPass.h @@ -589,6 +589,14 @@ struct SanityCheckPass final for (auto& param : f.parameters) duplicateNameChecker.check (param->name, param->context); + + if (f.block != nullptr) + { + // Ensure top level block variables do not duplicate parameter names + for (auto& s : f.block->statements) + if (auto v = cast (s)) + duplicateNameChecker.check (v->name, v->context); + } } void visit (AST::StructDeclaration& s) override