Thread overview
[Issue 20211] should be set appropriate version for enabled DIPs (in command lines)
Sep 16, 2019
anonymous4
Sep 16, 2019
KnightMare
Mar 20, 2020
Walter Bright
September 16, 2019
https://issues.dlang.org/show_bug.cgi?id=20211

--- Comment #1 from anonymous4 <dfj1esp02@sneakemail.com> ---
Try this:

template A()
{
int[] f(scope int[] a) @safe
{
    return a;
}
}

static assert(!__traits(compiles,A!()));

--
September 16, 2019
https://issues.dlang.org/show_bug.cgi?id=20211

--- Comment #2 from KnightMare <black80@bk.ru> ---
(In reply to anonymous4 from comment #1)
>
> Try this:
> 
> template A() {
>   int[] f(scope int[] a) @safe { return a; }
> }
> static assert(!__traits(compiles,A!()));

thank you.

current workaround:

template isDip1000EnabledImpl() {
    private template A() { int[] f( scope int[] a) @safe { return a; } }
    public enum isDip1000EnabledImpl = !__traits( compiles, A!());
}
alias isDip1000Enabled = isDip1000EnabledImpl!();

--
March 20, 2020
https://issues.dlang.org/show_bug.cgi?id=20211

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla@digitalmars.com
         Resolution|---                         |WONTFIX

--- Comment #3 from Walter Bright <bugzilla@digitalmars.com> ---
The workaround looks sufficient.

--