-
-
Notifications
You must be signed in to change notification settings - Fork 219
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
Support more than 2 logicals in XOR core function #2396
Labels
enhancement
New feature or request
Comments
The function was never intended to take more than 2 logical. We could possibly make it take more than 2 logicals tho. |
P0lip
changed the title
XOR core function no longer supports more than 2 logicals
Support more than 2 logicals in XOR core function
Feb 23, 2023
4 tasks
4 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
In Spectral5.9.2, the core XOR function could accept more than 2 items in its properties' list. In Spectral6+, the core XOR function only appears to support two logical.
To Reproduce
Create a ruleset that leverages the core XOR function:
each-component-property-must-contain-only-one:
given: $.components...properties.*
recommended: true
severity: warn
then:
function: xor
functionOptions:
properties:
- type
- oneOf
- $ref
This rule running on 5.9.2 will work with no issue
This rule running on 6+ will result in the following error:
Error #1: "xor" and its "properties" option support 2-item tuples, i.e. ["id", "name"]
Expected behavior
The XOR function will behave in the way that it always has, allowing more than just 2 logicals.
Additional context
I understand that from an electrical perspective, an XOR gate only takes two inputs, but XOR functionality can support an unlimited number of inputs in practical use. If this was an intended behavior change, then so be it, it just seems like an odd decision to make as it breaks compatibility and the docs page still lists the function as supporting a list of logicals.
Judging by commit histories, it looks like the xor function was completely redesigned in 6.0.0alpha1, this redesign seems to have limited it to two logicals
The text was updated successfully, but these errors were encountered: