mirror of
https://github.com/irmen/prog8.git
synced 2026-04-20 11:17:01 +00:00
bool variables were not converted to constants if that was possible
This commit is contained in:
@@ -39,7 +39,7 @@ class VarConstantValueTypeAdjuster(
|
||||
|
||||
// replace variables by constants, if possible
|
||||
if(options.optimize) {
|
||||
if (decl.sharedWithAsm || decl.type != VarDeclType.VAR || decl.origin != VarDeclOrigin.USERCODE || !decl.datatype.isNumeric)
|
||||
if (decl.sharedWithAsm || decl.type != VarDeclType.VAR || decl.origin != VarDeclOrigin.USERCODE || !decl.datatype.isNumericOrBool)
|
||||
return noModifications
|
||||
if (decl.value != null && decl.value!!.constValue(program) == null)
|
||||
return noModifications
|
||||
|
||||
Reference in New Issue
Block a user