Skip to content

allow shortcut refinement in constructors #1340

@gavinking

Description

@gavinking

It's quite irritating that the following doesn't work:

class Bool of true|false {
    shared new true {
        string => "true";
    }
    shared new false {
        string => "false";
    }
}

Instead we have to explicitly declare that we're refining Object.string.

We don't have time to fix this in 1.2.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions