Debian Codegraph @

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

raw
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/fail19103.d(14): Error: no property `puts` for `new C` of type `fail19103.C`
5 fail_compilation/fail19103.d(26): class `C` defined here
6 fail_compilation/fail19103.d(16): Error: no property `puts` for `s1` of type `fail19103.S1`
7 fail_compilation/fail19103.d(30): struct `S1` defined here
8 fail_compilation/fail19103.d(18): Error: no property `puts` for type `S2`, did you mean `core.stdc.stdio.puts`?
9 ---
10 */
11
12 void main()
13 {
14 (new C).puts("OK."); // Error: no property puts for type test.C, did you mean core.stdc.stdio.puts(T...)(T args)?
15 S1 s1;
16 s1.puts("Hey?"); // It can be compiled and runs!
17 S2 s2;
18 s2.puts("OK."); // Error: no property puts for type S2, did you mean core.stdc.stdio.puts(T...)(T args)?
19 }
20
21 mixin template T()
22 {
23 import core.stdc.stdio;
24 }
25
26 class C
27 {
28 mixin T;
29 }
30 struct S1
31 {
32 mixin T;
33 }
34
35 struct S2
36 {
37 import core.stdc.stdio;
38 }