Skip to content

Trait insteadof clause should accept a list of trait names instead of a single name #217

@TysonAndre

Description

@TysonAndre

The below code is syntactically valid, and needed to indicate which implementation of foo to inherit

<?php 
class C{
    use T1,T2,T3{T1::foo insteadof T2,T3;}
}

Currently, the specification says that it accepts a single name. https://github.com/php/php-langspec/blob/master/spec/16-traits.md#trait-uses

trait-select-insteadof-clause:
   name   insteadof   name

Should that be name 'insteadof' trait-name-list? Also, I'm not familiar with this project or why it's name instead of qualified-name

Noticed when working on microsoft/tolerant-php-parser#190

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions