Debian Codegraph @

gcc/testsuite/gdc.test/compilable/test18976.d

raw
1 // https://issues.dlang.org/show_bug.cgi?id=18976
2
3 class Expression : Statement {}
4 class Statement {}
5
6 class AssertSemanticVisitor
7 {
8 void visit (const Statement node) { }
9 }
10
11 class ExpressionVisitor : AssertSemanticVisitor
12 {
13 public void visit (Expression) { }
14
15 alias visit = typeof(super).visit;
16 }
17
18 class ExpressionVisitor2 : AssertSemanticVisitor
19 {
20 public void visit (Expression) { }
21
22 alias visit = AssertSemanticVisitor.visit;
23 }
24
25 void main ()
26 {
27 scope x1 = new ExpressionVisitor;
28 scope x2 = new ExpressionVisitor;
29 scope y = new Statement;
30 x1.visit(y);
31 x2.visit(y);
32 }