Skip to content

Allow "final" modifier when importing a method from a trait  #11388

Closed
@nicolas-grekas

Description

@nicolas-grekas

Description

Not sure why this is not allowed currently, but it'd be nice allowing it if there aren't any blockers:

trait SomeTrait {
    function someMethod() {}
}

class SomeClass {
    use SomeTrait {
        someMethod as final;
    }
}

This currently produces: "Cannot use 'final' as method modifier"

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