Skip to content

Improve error message when overriding untyped property with typed property #16866

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Nov 20, 2024

Conversation

chx
Copy link
Contributor

@chx chx commented Nov 19, 2024

No description provided.

@iluuu1994
Copy link
Member

iluuu1994 commented Nov 19, 2024

I think you're misunderstanding the message. The problem is not that it is already defined, but that it is defined differently. The message says the type must be omitted, "as in class X".

@chx
Copy link
Contributor Author

chx commented Nov 19, 2024

I just got this error message while updating a very large code base. The error message didn't quite help me so I am trying to make it easier to understand. Maybe this version is better?

Copy link
Member

@iluuu1994 iluuu1994 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll also need to update tests.

@chx
Copy link
Contributor Author

chx commented Nov 19, 2024

thanks for the excellent suggestion!

@chx
Copy link
Contributor Author

chx commented Nov 19, 2024

I only found these tests.

@TimWolla TimWolla changed the title Make error message clearer in zend_inheritance.c Improve error message when overriding untyped property with typed property Nov 20, 2024
@iluuu1994 iluuu1994 merged commit e5c2bc4 into php:master Nov 20, 2024
9 of 10 checks passed
@iluuu1994
Copy link
Member

Thank you @chx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants