ClangSharp icon indicating copy to clipboard operation
ClangSharp copied to clipboard

Binary operator overloads missing required parentheses

Open nathan-alden-sr opened this issue 5 years ago • 0 comments

From winnt.h:

public static JOB_OBJECT_NET_RATE_CONTROL_FLAGS Or(JOB_OBJECT_NET_RATE_CONTROL_FLAGS a, JOB_OBJECT_NET_RATE_CONTROL_FLAGS b)
{
    return (JOB_OBJECT_NET_RATE_CONTROL_FLAGS)((int)a) | ((int)b);
}

This is causing the following compiler error due to missing parentheses around the binary operator and its operands:

CS0019	Operator '|' cannot be applied to operands of type 'JOB_OBJECT_NET_RATE_CONTROL_FLAGS' and 'int'

nathan-alden-sr avatar May 09 '20 21:05 nathan-alden-sr