-
-
Notifications
You must be signed in to change notification settings - Fork 419
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
Flags.remove mutating to an incorrect value. #3776
Comments
Do you have a reproducible example? |
Example: use "collections"
actor Main
new create(env: Env) =>
let a = _TestFlagsFlags.>set(_TestFlagA)
let b = recover val _TestFlagsFlags.>set(_TestFlagB) end
if not a(_TestFlagA) then
env.out.print("pre Bad 1")
end
if a(_TestFlagB) then
env.out.print("pre Bad 2")
end
if a(_TestFlagC) then
env.out.print("pre Bad 3")
end
if a(_TestFlagD) then
env.out.print("pre Bad 4")
end
a.remove(b)
if not a(_TestFlagA) then
env.out.print("Bad 1")
end
if a(_TestFlagB) then
env.out.print("Bad 2")
end
if a(_TestFlagC) then
env.out.print("Bad 3")
end
if a(_TestFlagD) then
env.out.print("Bad 4")
end
type _TestFlagsFlags is Flags[(_TestFlagA|_TestFlagB|_TestFlagC|_TestFlagD),U8]
primitive _TestFlagA fun value(): U8 => 1
primitive _TestFlagB fun value(): U8 => 2
primitive _TestFlagC fun value(): U8 => 4
primitive _TestFlagD fun value(): U8 => 8 |
redvers
added a commit
to redvers/ponyc
that referenced
this issue
Jul 5, 2021
Flags.remove when given a flag to remove that wasn't currently present in the set, would turn the flag on. It should only be turning flags off, not turning them on. Closes ponylang#3776
redvers
added a commit
to redvers/ponyc
that referenced
this issue
Jul 5, 2021
Flags.remove when given a flag to remove that wasn't currently present in the set, would turn the flag on. It should only be turning flags off, not turning them on. Closes ponylang#3776
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The test fails as it's mutating to 0b0110.
PR incoming.
The text was updated successfully, but these errors were encountered: