Bug 19008 – core.internal.convert.toUbyte doesn't work on enums

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-06-19T12:47:13Z
Last change time
2018-06-25T18:33:17Z
Assigned to
No Owner
Creator
Nathan S.

Comments

Comment #0 by n8sh.secondary — 2018-06-19T12:47:13Z
Problem demonstrated: ``` void main() { import core.internal.convert : toUbyte; enum Month : uint { jan = 1} Month m = Month.jan; const bytes = toUbyte(m); // Doesn't compile. } ```
Comment #1 by github-bugzilla — 2018-06-25T18:33:13Z
Commits pushed to master at https://github.com/dlang/druntime https://github.com/dlang/druntime/commit/3e233e7e88bbf84d27cf87c33d94ab85f6f6fc12 Fix Issue 19008 - core.internal.convert.toUbyte doesn't work on enums https://github.com/dlang/druntime/commit/709270989ec493e18d82b5bb62b81208b570317f Merge pull request #2226 from n8sh/convert-19008 Fix Issue 19008 - core.internal.convert.toUbyte doesn't work on enums