1 /*
2 ---
3 fail_compilation/diag15713.d(18): Error: no property 'widthSign' for type 'Data'
4 fail_compilation/diag15713.d(38): Error: template instance test.conwritefImpl!("parse-int", "width", "\x0a", Data()) error instantiating
5 fail_compilation/diag15713.d(43):        instantiated from here: conwritefImpl!("main", "\x0a", Data())
6 fail_compilation/diag15713.d(48):        instantiated from here: fdwritef!()
7 ---
8 */
9 
wrWriteWidthChar()10 void wrWriteWidthChar() {}
11 
WrData(int,int)12 auto WrData(int , int )
13 {
14     struct Data
15     {
16         auto initInt(string name)()
17         {
18             __traits(getMember, this, name ~ "Sign");
19         }
20     }
21     return Data();
22 }
23 
24 template conwritefImpl(string state, string field, string fmt, alias data, AA...)
25 if (state == "parse-int")
26 {
27     enum conwritefImpl = data.initInt!field;
28 }
29 
baz(string state,string fmt,alias data,AA...)30 template baz(string state, string fmt, alias data, AA...) {}
bar(string state,string fmt,alias data,AA...)31 template bar(string state, string fmt, alias data, AA...) {}
32 
33     enum a = "parse-format";
34 
35 template conwritefImpl(string state, string fmt, alias data, AA...)
36 if (state == "main")
37 {
38     enum conwritefImpl = conwritefImpl!("parse-int", "width", fmt, data);
39 }
40 
fdwritef()41 void fdwritef()()
42 {
43     conwritefImpl!("main", "\n", WrData(0, 0));
44 }
45 
conwriteln()46 void conwriteln()
47 {
48     fdwritef();
49 }
50