[Issue 17145] [REG2.066.0] Tuple expansion error in local enum declaration

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Dec 17 09:36:40 UTC 2018


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

Simen Kjaeraas <simen.kjaras at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |simen.kjaras at gmail.com

--- Comment #3 from Simen Kjaeraas <simen.kjaras at gmail.com> ---
This compiles from 2.064 to 2.071.2, and again from 2.073.2:

auto tuple(T...)(T t) {
    struct Result {
        T expand;
    }
    return Result(t);
}

enum foo = tuple(1, 2).expand;
pragma(msg, typeof(foo).stringof);
pragma(msg, foo.stringof);

void bar()
{
        auto roo = tuple(1, 2).expand; // OK
        pragma(msg, typeof(roo).stringof);
        pragma(msg, roo.stringof);
}

This compiles from 2.064 to 2.065.0, but fails ever since:

auto tuple(T...)(T t) {
    struct Result {
        T expand;
    }
    return Result(t);
}

void baz()
{
        enum zoo = tuple(1, 2).expand; // Error: value of __tup1847 is not
known at compile time
        pragma(msg, typeof(zoo).stringof);
        pragma(msg, zoo.stringof);
}

--


More information about the Digitalmars-d-bugs mailing list