d: Merge upstream dmd, druntime 4ca4140e58, phobos 454dff14d.
[official-gcc.git] / gcc / testsuite / gdc.test / fail_compilation / ice12902.d
blob03763f7c18a535857b0619ea8f88744bbfa9c70e
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/ice12902.d(20): Error: variable `ice12902.main.__dollar` - type `void` is inferred from initializer `s.opDollar()`, and variables cannot be of type `void`
5 fail_compilation/ice12902.d(20): Error: expression `s.opDollar()` is `void` and has no value
6 ---
7 */
9 struct S
11 void opDollar() { }
12 void opIndex() { }
13 void opIndexAssign() { }
14 void opSliceAssign() { }
17 void main()
19 S s;
20 s[] = s[$];