]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gdc.test/fail_compilation/fail143.d
d: Import dmd b8384668f, druntime e6caaab9, phobos 5ab9ad256 (v2.098.0-beta.1)
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / fail_compilation / fail143.d
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/fail143.d(23): Error: need `this` for `next` of type `uint()`
5 fail_compilation/fail143.d(30): Error: template instance `fail143.Foo!int` error instantiating
6 ---
7 */
8
9 class Quux
10 {
11 uint x;
12
13 final uint next()
14 {
15 return x;
16 }
17 }
18
19 template Foo(T)
20 {
21 void bar()
22 {
23 int r = Quux.next;
24 }
25 }
26
27 int main(char[][] args)
28 {
29 auto prng = new Quux();
30 alias Foo!(int).bar baz;
31
32 int x = prng.next;
33 baz();
34
35 return 0;
36 }