[Issue 10803] New: pragma(msg, ...) fails with enum TypeTuple: compilaton error
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Aug 11 17:38:24 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10803
Summary: pragma(msg, ...) fails with enum TypeTuple: compilaton
error
Product: D
Version: unspecified
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: 2krnk at gmx.net
--- Comment #0 from det <2krnk at gmx.net> 2013-08-11 17:38:22 PDT ---
see example below. with the last pragma commented out, the program works fine,
including 'enum er'.
with the pragma active, compilation fails. error message appears
at point of pragma processing, with the line number of the
enum er definition though.
...Error: variable _er_field_0,1,2 cannot be read at compile time
tested with DMD 2.063.2 win32 on home machine as well as with 2.063.2 64b and
latest git head via DPaste http://dpaste.dzfl.pl/36674a13
module testcase;
import std.stdio, std.typetuple;
enum ok = [TypeTuple!("one", "two", "three")];
enum er = TypeTuple!("one", "two", "three");
pragma( msg, "one", "two", "three" );
// onetwothree
pragma( msg, ok );
// ["one", "two", "three"]
pragma( msg, TypeTuple!("one", "two", "three") );
// tuple("one", "two", "three")
pragma( msg, er );
// with the pragma above commented out, the program works fine,
// including the enum er.
// with the pragma active, compilation fails. error message appears
// at point of pragma processing, with the line number of the
// enum er definition though:
// Error: variable _er_field_0,1,2 cannot be read at compile time
void main(){
writeln( "one", "two", "three" );
// onetwothree
writeln( ok );
// ["one", "two", "three"]
writeln( er );
// onetwothree
}
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list