Issue 24095 - std.bitmanip.bitfields no longer works with bool enum types
Summary: std.bitmanip.bitfields no longer works with bool enum types
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All All
: P1 regression
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2023-08-22 00:24 UTC by elpenguino+D
Modified: 2024-11-17 01:03 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description elpenguino+D 2023-08-22 00:24:14 UTC
```
import std.bitmanip;

enum Bar : bool {
	a,
	b,
}

struct Foo {
	mixin(bitfields!(
		Bar, "bar", 1,
		ubyte, "", 7,
	));
}
```
This compiled before DMD 2.103.0. Now it produces two errors: 'Error: operation not allowed on `bool` `result <<= 7u`' and 'Error: operation not allowed on `bool` `result >>>= 7u`'.

This regression appears to have been introduced by https://github.com/dlang/phobos/pull/8663
Comment 1 Dlang Bot 2024-08-06 12:50:38 UTC
@RubyTheRoobster updated dlang/phobos pull request #9043 "Issue 24095 - std.bitmanip.bitfields no longer works with bool enum t…" fixing this issue:

- Fix Bugzilla Issue 24095 - std.bitmanip.bitfields no longer works with bool enum types

https://github.com/dlang/phobos/pull/9043
Comment 2 Dlang Bot 2024-08-19 12:05:42 UTC
dlang/phobos pull request #9043 "Issue 24095 - std.bitmanip.bitfields no longer works with bool enum t…" was merged into stable:

- b795df6df278e9647e4f4967bcd6c694e3a76263 by RubyTheRoobster:
  Fix Bugzilla Issue 24095 - std.bitmanip.bitfields no longer works with bool enum types

https://github.com/dlang/phobos/pull/9043
Comment 3 Dlang Bot 2024-11-17 01:03:57 UTC
dlang/phobos pull request #9086 "Merge stable" was merged into master:

- cd026126dbb0537cd98a6b78f8c6b726ecf75be2 by RubyTheRoobster:
  Issue 24095 - std.bitmanip.bitfields no longer works with bool enum t… (#9043)
  
  * Fix Bugzilla Issue 24095 - std.bitmanip.bitfields no longer works with bool enum types
  
  * Fix trailing whitespace
  
  * Remove extra space

https://github.com/dlang/phobos/pull/9086