[Issue 22865] New: __traits(compiles) affects inferrence of attributes

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Mar 9 18:45:21 UTC 2022


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

          Issue ID: 22865
           Summary: __traits(compiles) affects inferrence of attributes
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: elpenguino+D at gmail.com

```
@safe unittest {
    foo();
}
auto foo() {
    immutable(ubyte)[] data;
    enum bar = __traits(compiles, cast(ubyte[])data);
}
```
Whether bar evaluates to true or false in this context I do not know. In either
case, it shouldn't directly affect whether or not @safe is inferred.

--


More information about the Digitalmars-d-bugs mailing list