From faefc68cc0024e9f54262a79634238a3f063be72 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Sat, 5 Feb 2022 11:26:58 -0500 Subject: [PATCH] Fixed `allowRef` for default values for failed local var inits --- IDEHelper/Compiler/BfStmtEvaluator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/IDEHelper/Compiler/BfStmtEvaluator.cpp b/IDEHelper/Compiler/BfStmtEvaluator.cpp index 92882019..5f79e5b5 100644 --- a/IDEHelper/Compiler/BfStmtEvaluator.cpp +++ b/IDEHelper/Compiler/BfStmtEvaluator.cpp @@ -1737,12 +1737,12 @@ BfLocalVariable* BfModule::HandleVariableDeclaration(BfVariableDeclaration* varD if (isConst) { Fail("Const locals must be initialized", varDecl->mModSpecifier); - initValue = GetDefaultTypedValue(resolvedType); + initValue = GetDefaultTypedValue(resolvedType, true); } else if (isReadOnly) { Fail("Readonly locals must be initialized", varDecl->mModSpecifier); - initValue = GetDefaultTypedValue(resolvedType); + initValue = GetDefaultTypedValue(resolvedType, true); } else if (auto refTypeRef = BfNodeDynCast(varDecl->mTypeRef)) {