[Issue 20346] New: std.uuid does not compile with checkaction=context
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Fri Nov  1 22:00:11 UTC 2019
    
    
  
https://issues.dlang.org/show_bug.cgi?id=20346
          Issue ID: 20346
           Summary: std.uuid does not compile with checkaction=context
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: druntime
          Assignee: nobody at puremagic.com
          Reporter: moonlightsentinel at disroot.org
Reduced test case:
struct UUID
{
        union
        {
            ubyte[] data;
        }
}
unittest
{
        ubyte[] data;
        enum ctfe = UUID();
        assert(ctfe.data == data);
}
=> Error: cannot modify constant expression UUID(null).data
This is caused by _d_assert_fail taking a mutable reference to an immutable
enum member.
Ommiting the union { ... } does not trigger this error, this seems to be
another DMD bug
--
    
    
More information about the Digitalmars-d-bugs
mailing list