Debian Codegraph @

gcc/testsuite/gdc.test/fail_compilation/fail16600.d

raw
1 /* TEST_OUTPUT:
2 ---
3 fail_compilation/fail16600.d(22): Error: `fail16600.S.__ctor` called with argument types `(string) const` matches multiple overloads exactly:
4 fail_compilation/fail16600.d(16): `fail16600.S.this(string __param_0)`
5 and:
6 fail_compilation/fail16600.d(17): `fail16600.S.this(string __param_0) immutable`
7 ---
8 */
9
10 // https://issues.dlang.org/show_bug.cgi?id=16600
11
12 struct S
13 {
14 int i;
15
16 this(string) { i = 1; }
17 this(string) immutable { i = 2; }
18 }
19
20 void main()
21 {
22 auto a = const(S)("abc");
23 assert(a.i == 2);
24 }