Debian Codegraph @

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

raw
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/diag10768.d(35): Error: cannot implicitly override base class method `diag10768.Frop.frop` with `diag10768.Foo.frop`; add `override` attribute
5 ---
6 */
7
8 struct CirBuff(T)
9 {
10
11 CirBuff!T opAssign(R)(R)
12 {}
13
14 T[] toArray()
15 {
16 T[] ret; // = new T[this.length];
17 return ret;
18 }
19 alias toArray this;
20 }
21
22 class Bar(T=int)
23 {
24 CirBuff!T _bar;
25 }
26
27 class Once
28 {
29 Bar!Foo _foobar;
30 }
31
32 class Foo : Frop
33 {
34 // override
35 public int frop() { return 1; }
36 }
37
38 class Frop
39 {
40 public int frop() { return 0; }
41 }