summaryrefslogtreecommitdiff
path: root/source/slang/slang-check-stmt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-check-stmt.cpp')
-rw-r--r--source/slang/slang-check-stmt.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/slang/slang-check-stmt.cpp b/source/slang/slang-check-stmt.cpp
index b819945fd..b68465087 100644
--- a/source/slang/slang-check-stmt.cpp
+++ b/source/slang/slang-check-stmt.cpp
@@ -57,6 +57,15 @@ namespace Slang
void SemanticsStmtVisitor::visitBlockStmt(BlockStmt* stmt)
{
+ // Make sure to fully check all nested agg type decls first.
+ if (stmt->scopeDecl)
+ {
+ for (auto decl : stmt->scopeDecl->members)
+ {
+ if (as<AggTypeDeclBase>(decl))
+ ensureAllDeclsRec(decl, DeclCheckState::DefinitionChecked);
+ }
+ }
checkStmt(stmt->body);
}