Skip to content

Comments

Fix “Unsafe usage of new static()” by making EmptyResponse final#216

Open
arshidkv12 wants to merge 1 commit intolaminas:3.7.xfrom
arshidkv12:3.7.x
Open

Fix “Unsafe usage of new static()” by making EmptyResponse final#216
arshidkv12 wants to merge 1 commit intolaminas:3.7.xfrom
arshidkv12:3.7.x

Conversation

@arshidkv12
Copy link

@arshidkv12 arshidkv12 commented Aug 17, 2025

Marking EmptyResponse as final prevents late static binding issues
when instantiating with new static(), ensuring type safety and
avoiding potential runtime errors in subclasses.

Q A
Documentation no
Bugfix yes
BC Break yes
New Feature no
RFC no
QA no

Description

Marking EmptyResponse as final prevents late static binding issues
when instantiating with new static(), ensuring type safety and
avoiding potential runtime errors in subclasses.

Signed-off-by: Arshid <arshidkv12@gmail.com>
@samsonasik
Copy link
Member

This is bc break, can't land in minor version.

There should be no child for this class, extends parent Response instead.

If needed, use

/** @final */

so no bc break, while inform user to not extends it.

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