Skip to content

Commit

Permalink
fix(zscript): global var initializers not erroring when non-constant
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilyV99 authored and connorjclark committed Dec 23, 2023
1 parent 42b94c7 commit e1b10e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/parser/RegistrationVisitor.cpp
Expand Up @@ -833,7 +833,7 @@ void RegistrationVisitor::caseVarInitializer(ASTExprVarInitializer& host, void*
if(host.valueIsArray(scope, this)) doRegister(host);
else
{
host.value = host.content->getCompileTimeValue(this, scope).value_or(0L); // sometimes has no value
host.value = host.content->getCompileTimeValue(this, scope);
if(host.value) doRegister(host);
}
}
Expand Down

0 comments on commit e1b10e2

Please sign in to comment.