Thread overview
The compiler can't "see" an inner class
Oct 27, 2019
Emmanuelle
Oct 27, 2019
Simen Kjærås
Oct 27, 2019
Emmanuelle
October 27, 2019
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!
October 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
October 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
>
> --
>   Simen

Yikes! Thanks for submitting the issue to bugzilla :)