]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gdc.test/fail_compilation/fail23406.d
Merge remote-tracking branch 'origin/master' into devel/c++-contracts
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / fail_compilation / fail23406.d
CommitLineData
7e7ebe3e
IB
1// https://issues.dlang.org/show_bug.cgi?id=23406
2
3/*
4TEST_OUTPUT:
5---
6fail_compilation/fail23406.d(39): Error: cannot implicitly convert expression `0` of type `int` to `alphakey`
7---
8*/
9
10struct flagenum
11{
12 int i = 1;
13 alias i this;
14
15 auto opBinary(string s)(int j)
16 {
17 assert(j == 1);
18 return typeof(this)(i*2);
19 }
20
21 auto opEquals(int a)
22 {
23 return false;
24 }
25}
26
27enum alphakey
28{
29 a = flagenum(),
30 b,c,d,e,f,g,h,i,
31 k,l,m,n,o,p,q,r,
32 s,t,u,v,w,x,y,z
33}
34
35alphakey alpha;
36
37void main()
38{
39 alpha = 0;
40}