Skip to content

Conversation

@TysonAndre
Copy link
Contributor

@TysonAndre TysonAndre commented Sep 11, 2020

I forgot that anonymous classes were parsed into an
ObjectCreationExpression instead.

Also support attributes there, cause a diagnostic to be emitted if the
attribute group(s) aren't followed by the class keyword.

Add attributes support for TraitDeclaration and InterfaceDeclaration
in the same way it was added earlier for ClassDeclaration.

For #320

I forgot that anonymous classes were parsed into an
ObjectCreationExpression instead.

Also support attributes there, cause a diagnostic to be emitted if the
attribute group(s) aren't followed by the `class` keyword.

For microsoft#320
They were already supported on ClassDeclaration.
The php runtime allows attributes on all classlikes,
including traits/interfaces.
@TysonAndre TysonAndre changed the title Also handle new #[MyAttr] class {...} Also handle attributes in new #[MyAttr] class {...}, traits, interfaces Sep 11, 2020
@TysonAndre
Copy link
Contributor Author

@roblourens - this is ready for review. I didn't notice anything else missing when working on an application using tolerant-php-parser

@roblourens roblourens merged commit c91c8a1 into microsoft:master Sep 12, 2020
@TysonAndre TysonAndre deleted the anonymous-class-attributes branch March 27, 2021 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants