You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var target = new Interpreter();
var parameters = new[]{
new Parameter(nameof(a), typeof(int)),
new Parameter(nameof(b), typeof(int)),
};
Assert.DoesNotThrow(() => target.Parse("a += b", parameters));
As per the operator overloading documentation, "When a binary operator is overloaded, the corresponding compound assignment operator, if any, is also implicitly overloaded."
This can be worked around by changing our eval text to "a = (a + b)"
The text was updated successfully, but these errors were encountered:
Another consideration is that allowing to change parameter value can cause some problems (security?). Consider the case where where two expressions are evaluated with the same parameter and the first expression change it ...
I know that from C# perspective this is valid, but maybe considering parameters read only is better in term of design.
As an example where this can already be a valid use case from one of the existing unit tests (Assignment_Operator_Equal) would be to have an additional test like (to show a lot of edge cases)
Currently, the below is not supported.
As per the operator overloading documentation, "When a binary operator is overloaded, the corresponding compound assignment operator, if any, is also implicitly overloaded."
This can be worked around by changing our eval text to
"a = (a + b)"
The text was updated successfully, but these errors were encountered: