[Issue 17145] New: Tuple expansion does not work in local enum declaration
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sat Feb 4 04:02:28 PST 2017
https://issues.dlang.org/show_bug.cgi?id=17145
Issue ID: 17145
Summary: Tuple expansion does not work in local enum
declaration
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Keywords: CTFE, rejects-valid
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: epi at atari8.info
import std.typecons : tuple;
enum foo = tuple(1, 2).expand; // Compiles up to 2.071.2 and with PR #6517
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);
}
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