Incorrect lineno for property and class const variance check
オープン
まだ誰も着手していません。
Category: Engine
Feature
Status: Verified
- 主要言語
- C
- スター
- 40.4k
- フォーク
- 8.2k
- 平均マージ
- 2日 13時間
- マージ済み PR(30日)
- 96
説明
Description
The following code:
<?php
class C extends P {
public const int X = 42;
}
class P {
public const string X = 'X';
}
Resulted in this output:
Fatal error: Type of C::X must be compatible with P::X of type string in /in/ZAZYv on line 3
But I expected this output instead:
Fatal error: Type of C::X must be compatible with P::X of type string in /in/ZAZYv on line 4
Same goes for properties. From property hooks feedback:
https://github.com/php/php-src/pull/13455#discussion_r1499322256
PHP Version
*
Operating System
No response
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
クラス定数の例を再現し、報告された行を期待される 4 行目と比較してから、PHP インタープリターにおける分散チェックの診断経路を調査する。Property Hooks のフィードバックで参照されている、対応するプロパティのケースを確認する。プロパティとクラス定数の両方のエラーが、互換性のない子メンバーの宣言行を報告すれば完了とする。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- c, php
- 領域
- compilers
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100