metagen: processDerivedClassRefs converts ancestor methods to properties using subclass selectors (phantom accessors in emitted metadata)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 42/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- cpp, objective-c
- 領域
- tooling
調査の方向性
Start in metadata-generator/src/IR/Class.cpp with processDerivedClassRefs, which calls convertMethodToPropertyIfNeeded in the wrong direction, and trace how ClassDecl::postProcessMembers invokes it. Confirm that an ancestor method record can be rewritten with a descendant's getter and setter selectors. Done means the ancestor keeps its own method record, such as NSView.autoscroll not gaining isAutoscroll, while superclass-to-subclass property propagation still works.
索引モデルが issue の本文から書いたものです。
説明
Summary
processDerivedClassRefs in metadata-generator/src/IR/Class.cpp calls convertMethodToPropertyIfNeeded in the wrong direction: it rewrites an ancestor class's method record into a property using the derived class's getter/setter selectors. Generated metadata then declares members on classes that never implement those selectors.
ClassDecl::postProcessMembers iterates members of a class, then runs processDerivedClassRefs(member, derivedClassRefs), which invokes convertMethodToPropertyIfNeeded(member /* ancestor member */, cls->getMemberNamed(member.name) /* derived member */, false). Inside, when memberInSuperclass->kind == kMemberProperty — i.e. the derived class declared a property — the ancestor's method is converted to a property that copies memberInSuperclass->getterSelector/setterSelector, selectors that belong to the subclass and that the ancestor does not implement.
Observed in metadata.macos.arm64.nsmd (generated for the macosx SDK): a census found 213 phantom getters and 212 phantom setters. Example: NSView.autoscroll/NSClipView.autoscroll carry NSMatrix's isAutoscroll/setAutoscroll: — messaging a stock NSView with isAutoscroll raises -[NSView isAutoscroll]: unrecognized selector sent to instance.
Expected
A derived class's member declarations should not mutate the ancestor's member record; the property conversion should only flow superclass → subclass (which the postProcessMembers superclass walk already handles). Either drop the processDerivedClassRefs conversion or scope it so an ancestor never borrows a descendant's selectors.
Environment
NativeScript/runtimesmain(verified identical at5b697b39)metadata-generatorsource + generatedmetadata.macos.*.nsmd- Impact is multiplied by the napi backend's unguarded selector dispatch — reading any phantom member aborts the process instead of raising a JS error (filed separately).
- 主要言語
- C++
- スター
- 27
- フォーク
- 4
- 平均マージ
- 5日 11時間
- マージ済み PR(30日)
- 12
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
NativeScript/runtimes のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
NativeScript/runtimes#111 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 22/100
NativeScript/runtimes#110 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 32/100
NativeScript/runtimes#109 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 18/100
NativeScript/runtimes#108 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 40/100
NativeScript/runtimes#107 ·
メンテナーはふだん 1 日以内に返信
NativeScript/runtimes の issue をすべて見る
似ている issue
-
`BLMPOP` with COUNT 0 or numkeys 0 hangs対応中かも @ggyuchive が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
gObjectFullbrightAlphaMaskProgram in newview/llviewershadermgr.cpp is defined but never initializedオープンbug triage
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
secondlife/viewer#6620 ·
メンテナーはふだん 1 日以内に返信
-
bug core p3
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
RunanywhereAI/runanywhere-sdks#1258 ·
メンテナーはふだん 1 日以内に返信
-
ripwire-router skill: stale language list (15 vs 26 supported; Elixir/PHP/Kotlin wrongly listed as unsupported)対応中かも @joyful-ii-V-I が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
redhat-et/ripwire#521 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信