ceylon / ceylon-spec

DEPRECATED
Apache License 2.0
108 stars 34 forks source link

Support metamodel and declaration references to nested anonymous classes #1013

Closed lucaswerkmeister closed 9 years ago

lucaswerkmeister commented 10 years ago

If you have something like

shared object a {
    shared object b {
        shared object c {
        }
    }
}

there’s currently no way to get a metamodel reference to a.b.c – the spec and the parser both only allow one level of nesting for member names.

lucaswerkmeister commented 10 years ago

there’s currently no way to get a metamodel reference to a.b.c

Well, that’s not completely true. You can totally get a reference like this:

assert (exists cDec = `value a.b`.objectClass?.getMemberDeclaration<ValueDeclaration>("c"));

It’s just not as convenient (and not typechecked).

lucaswerkmeister commented 9 years ago

Solved as part of #1243. Use \Ia.\Ib.\Ic to refer to the c class and \Ia.\Ib.c to refer to the c attribute.