www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19009] New: core.internal.hash.hashOf default hash (absent

https://issues.dlang.org/show_bug.cgi?id=19009

          Issue ID: 19009
           Summary: core.internal.hash.hashOf default hash (absent
                    `toHash`) should be ` nogc`
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: druntime
          Assignee: nobody puremagic.com
          Reporter: n8sh.secondary hotmail.com

The default `hashOf` implementation used for types that do not have `toHash`
uses `toUbyte` to get the byte representation which during CTFE requires
allocation but during execution does not. The compiler currently takes
CTFE-only code into account when inferring attributes but we can give it some
help.

--
Jun 20 2018