apache / apache/netbeans

Anonymous class using a trait with asbtract method inside another class

Open
#8,527 0 comments 1 reaction 0 assignees View on GitHub
kind:bug needs:triage PHP
Dominant language
Java
Stars
3.1k
Forks
935
Avg merge
2d 3h
Merged PRs (30d)
17

Description

### Apache NetBeans version

Apache NetBeans 26 latest release candidate

### What happened

Using anonymous class inside a class that uses a trait with an asbtract method causes a missing implementation issue on the wrapping class

![Image](https://github.com/user-attachments/assets/1e14d0dc-57dc-420e-ad83-1cfd23b57c62)

### Language / Project Type / NetBeans Component

PHP

### How to reproduce

The issue can be reproduced just using the following code.
For simplicity I added both a test trait and a consumer test class in the same file

```php

Contributor guide

Open the contributing guide

Research direction

No source file or test is named. Start by reproducing the diagnostic in the NetBeans PHP editor with the trait and anonymous-class example from the issue, then trace how abstract trait methods are checked for anonymous classes nested in another class. Done means the wrapping class is no longer reported as missing an implementation when the anonymous class implements the method.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.