From d179f0eec263d6ba2d7c1594564d4161750b2369 Mon Sep 17 00:00:00 2001 From: ArielG-NV <159081215+ArielG-NV@users.noreply.github.com> Date: Wed, 14 May 2025 13:15:48 -0700 Subject: 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. --- source/slang/slang-check-decl.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source') 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); } -- cgit v1.2.3