digitalmars.D.learn - The compiler can't "see" an inner class
- Emmanuelle (25/25) Oct 27 2019 Hello! See snippet:
- Simen =?UTF-8?B?S2rDpnLDpXM=?= (15/40) Oct 27 2019 It's a bug:
- Emmanuelle (2/16) Oct 27 2019 Yikes! Thanks for submitting the issue to bugzilla :)
Hello! See snippet: --- interface AST { static interface Expr : AST { final static class Name : Expr { override void accept(AST.Visitor v) { v.visitName(this); } } } final static class Visitor { void visitName(AST.Expr.Name name); } void accept(AST.Visitor v); } --- If you try to compile that, dmd v2.088.0 complains: --- Error: no property Name for type onlineapp.AST.Expr --- How come? It's defined right there. I would really like some pointers on this, thanks!
Oct 27 2019
On Sunday, 27 October 2019 at 17:52:51 UTC, Emmanuelle wrote:Hello! See snippet: --- interface AST { static interface Expr : AST { final static class Name : Expr { override void accept(AST.Visitor v) { v.visitName(this); } } } final static class Visitor { void visitName(AST.Expr.Name name); } void accept(AST.Visitor v); } --- If you try to compile that, dmd v2.088.0 complains: --- Error: no property Name for type onlineapp.AST.Expr --- How come? It's defined right there. I would really like some pointers on this, thanks!It's a bug: interface A { interface B : A { class C : B { } } // Fails: no property 'C' for type 'foo.A.B' void inside(A.B.C c) { } } // Works void outside(A.B.C c) { } https://issues.dlang.org/show_bug.cgi?id=20329 -- Simen
Oct 27 2019
On Sunday, 27 October 2019 at 19:54:06 UTC, Simen Kjærås wrote:It's a bug: interface A { interface B : A { class C : B { } } // Fails: no property 'C' for type 'foo.A.B' void inside(A.B.C c) { } } // Works void outside(A.B.C c) { } https://issues.dlang.org/show_bug.cgi?id=20329 -- SimenYikes! Thanks for submitting the issue to bugzilla :)
Oct 27 2019