Skip to content

Commit

Permalink
- unary minus operator propagates boolean operand to integer
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-lysiuk committed Jan 12, 2019
1 parent d64dac9 commit 5e5f27d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/scripting/backend/codegen.cpp
Expand Up @@ -1881,6 +1881,12 @@ FxExpression *FxMinusSign::Resolve(FCompileContext& ctx)
delete this;
return e;
}
else if (Operand->ValueType == TypeBool)
{
Operand = new FxIntCast(Operand, true);
Operand = Operand->Resolve(ctx);
assert(Operand != nullptr);
}
ValueType = Operand->ValueType;
return this;
}
Expand Down

0 comments on commit 5e5f27d

Please sign in to comment.