Skip to content

Commit

Permalink
[ternary] Fix with void types
Browse files Browse the repository at this point in the history
  • Loading branch information
5pilow committed Jul 4, 2023
1 parent e026fb7 commit 8948e6b
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,11 @@ public void analyze(WordCompiler compiler) throws LeekCompilerException {
}

if (mExpression1 != null && mExpression2 != null) {
type = Type.compound(mExpression1.getType(), mExpression2.getType());
var type1 = mExpression1.getType();
var type2 = mExpression2.getType();
if (type1 == Type.VOID) type1 = Type.NULL;
if (type2 == Type.VOID) type2 = Type.NULL;
type = Type.compound(type1, type2);
}
}

Expand Down

0 comments on commit 8948e6b

Please sign in to comment.