Skip to content

Fix GH-14874: report correct line for property/const variance errors#21993

Open
iliaal wants to merge 1 commit intophp:masterfrom
iliaal:fix/gh-14874-property-const-variance-lineno
Open

Fix GH-14874: report correct line for property/const variance errors#21993
iliaal wants to merge 1 commit intophp:masterfrom
iliaal:fix/gh-14874-property-const-variance-lineno

Conversation

@iliaal
Copy link
Copy Markdown
Contributor

@iliaal iliaal commented May 9, 2026

Fixes #14874. Adds a uint32_t line field to zend_property_info and zend_class_constant captured from the AST node, so the variance emitters route through zend_error_at_noreturn and point at the offending child member. Members left at line 0 (internal classes, trait-copied properties) fall back to the legacy emitter.

Add a uint32_t line field to zend_property_info and zend_class_constant,
populated from the AST node lineno at compile time. The variance
emitters route through zend_error_at_noreturn so the error points at
the offending child member rather than the class declaration. Members
left at line 0 (internal classes, trait-copied properties) fall back
to zend_error_noreturn (legacy behavior, no regression).

Fixes phpGH-14874
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.

Incorrect lineno for property and class const variance check

1 participant