[Issue 18617] New: need __traits(deprecated, expr) to check whether an expression would trigger deprecation
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Mar 15 09:12:49 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=18617
Issue ID: 18617
Summary: need __traits(deprecated, expr) to check whether an
expression would trigger deprecation
Product: D
Version: D2
Hardware: x86
OS: Mac OS X
Status: NEW
Severity: enhancement
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: timothee.cour2 at gmail.com
we need __traits(deprecated, expr) to check whether an expression would trigger
deprecation
this is analog to __traits(compiles, expr) but checks for deprecation instead
of whether something compiles.
eg use case (from
https://github.com/dlang/phobos/pull/6178#pullrequestreview-104095990)
```
static assert(__traits(deprecated, {int[] a2 = [1, 2].asStatic;}));
instead of simply having a comment:
// NOTE: correctly issues a deprecation
// int[] a2 = [1, 2].asStatic;
```
--
More information about the Digitalmars-d-bugs
mailing list