Skip to content

omitting outer class prefix #263

Open
@nyuichi

Description

@nyuichi

I really want a new syntax to access inner classes from inside them that replaces the current long descriptive syntax forcing users to write the full path (including all outiside classes the inner class belongs).

class Outer {
    class Inner {
        static function makeInner () : Inner {
            return new Inner(); // the current spec requires the full path even for *myself*, like `new Outer.Inner()`
        }
    }
    function makeInner () : Inner {
        return new Inner; // One problem is the places where we should allow the omit for inner class names. Inside the inner itself is surely OK, but how about inside the outer?
    }
}

This change, once pulled to master, breaks the backward-compatibility. But I believe it is worth breaking because the current one is not so useful and practical.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions