summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorArielG-NV <159081215+ArielG-NV@users.noreply.github.com>2025-05-14 13:15:48 -0700
committerGitHub <noreply@github.com>2025-05-14 20:15:48 +0000
commitd179f0eec263d6ba2d7c1594564d4161750b2369 (patch)
treebfbfb8e92a9d1b956ba2452f9c75bc2b9df21465 /source
parent4a3872cd3bbc44036e8acec0ba57233e1eab51e8 (diff)
Infer type while constant folding causes failure (#7090)
Problem: * Infering type with `let` while using constant-foldable object's means we run in a circular loop of `ensureDecl`. Changes: * If we constant-fold we effectively are ready to check definition. If we are not a constant to fold, we run `setCheckState` after anyways.
Diffstat (limited to 'source')
-rw-r--r--source/slang/slang-check-decl.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/slang/slang-check-decl.cpp b/source/slang/slang-check-decl.cpp
index dbd52ebea..c2c0c2cb6 100644
--- a/source/slang/slang-check-decl.cpp
+++ b/source/slang/slang-check-decl.cpp
@@ -1836,6 +1836,8 @@ void SemanticsDeclHeaderVisitor::checkVarDeclCommon(VarDeclBase* varDecl)
varDecl->initExpr = initExpr;
varDecl->type.type = initExpr->type;
+
+ varDecl->setCheckState(DeclCheckState::DefinitionChecked);
_validateCircularVarDefinition(varDecl);
}