-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"at least one operator should not be static" not triggered for 2 static arrays #17
Comments
good catch. The generated Code isn't actually correct either, as huml.NONE_OF(T left, T... right) will now treat one of the left arrays members as members of the right array. |
Another question would be how equality of Arrays should be handled in general. |
I would say two arrays are equal if they have the same length and the same elements in the same order. |
Ofc, as a programmer, it is easy to decide when two arrays are equal. However the user of our software may not be a programmer. Maybe for him/her arrays are simply lists and as long as they contain the same items, theyre the same. I think we have to keep in mind here, who will eventually be writing the rules. A possible solution would be more expressive, arrays specific operators like "same order" and "same content" |
Agreeing with @matthiaskrgr here. The functionality should work as similar as possible to a standart library. i tend to lean more towards the java approch of checking the arrays contents, than the c# approch of checking for pointer equality. see references: |
@lionelpa this is still an issue. candidate for 0.0.5 ? |
This example confuses me somewhat. I see several problems at this point.
First we have to make sure that we always throw a corresponding error if a condition contains 2 static elements. No matter what type they are. Then we have to take care in a separate issue that the numbers 1,1 are also recognized as decimal numbers. And then we have to see, if we want to compare 2 arrays with each other, that we provide a function for that. And if then we want to compare the contents of the arrays. But at this point there are many different comparison variations. In any case we should treat the individual points in separate issues. |
Usually a rule like
1 has to be 1
triggers an error on the playground "at least one operator should not be static" however this is not the case for two equal arrays:The validation rule
0,0 has to be 0,0
generates the codeIs this a bug?
The text was updated successfully, but these errors were encountered: