[Issue 19439] New: Make __traits(getAliasThis) return empty tuple for non-aggregate types
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Nov 27 05:52:11 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=19439
Issue ID: 19439
Summary: Make __traits(getAliasThis) return empty tuple for
non-aggregate types
Product: D
Version: D2
Hardware: x86_64
OS: All
Status: NEW
Severity: enhancement
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: n8sh.secondary at hotmail.com
It is frequently necessary to verify that aliasing is not occurring. Checking
that the result of __traits(getAliasThis) has length 0 is a concise and natural
way of doing this. Unfortunately it is currently disallowed to `getAliasThis` a
non-aggregate type. Returning an empty tuple instead of raising a compile-time
error would also be convenient for using `getAliasThis` in type-generic code.
It should not make DMD slower to change this behavior: not raising an error
slightly simplifies the logic.
--
More information about the Digitalmars-d-bugs
mailing list