-
Notifications
You must be signed in to change notification settings - Fork 94
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
Issue checking duplicate variant indexes when using #[bitflags]
#692
Comments
#[bitflags]
Maybe the error is correct though, encoding |
But it is true that there is also a breaking change that was introduced forcing the discriminant to be a literal. Here can be a fix: #695 |
But they shouldn't have the same index. From what I understand the indexes would be:
For example:
This code outputs:
So the duplicate indexes check is wrong in this case |
Yes, and the old implementation (
While the new one (
which is wrong |
I see, the discriminant is ignored when it is an expression: https://github.com/paritytech/parity-scale-codec/pull/687/files#r1937043283 |
I added the fix in the branch #695 |
fixed on master |
Related to #691 and #690
This will lead to a compilation error:
That's because
#[bitflags]
does:And this will not work well with the duplicate variant indexes checking logic introduced in #653 and #687
Example of polkadot-sdk structure using
#[bitflags]
:ItemSettings
The text was updated successfully, but these errors were encountered: