ACE_TAO icon indicating copy to clipboard operation
ACE_TAO copied to clipboard

TAO_IDL Constant Expression Coercion Failure

Open iguessthislldo opened this issue 3 years ago • 0 comments

Like #1284, this comes from the IDL from this PR and is still there because I think it's correct.

This IDL:

const short expr = (4 * (2 + 6) / 2 - 7) % 6;

results in:

Error - tao_idl: "expr.idl", line 1: coercion failure 9 % 6 to short

The same happens when the expression is 9 % 6, but not 3 or when short is changed to long. It seems like AST_Expression should be more loose with what type an expression can be until it needs to be coerced.

iguessthislldo avatar Nov 09 '20 05:11 iguessthislldo