Properties generated from private fields do not conflict/trigger CS0108 or any other warning
まだ誰も着手していません。
評価
調査の方向性
ObservableProperty のソースジェネレーター実装から始めて、その診断または警告のテストを見つけ、issue の TypeA/TypeB の例を再現します。private フィールドから生成されたプロパティが継承をまたいでどのようにチェックされるかを確認し、CS0108 のような明確な隠蔽診断、または MVVM 固有の警告が生成されれば、報告されたケースは完了とみなします。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
Given two types, where one is derived from the other, adding a private field to the derived type with the same name as a private field on the base type will generate a property on each type's generated partial definition. Because code analysis is disabled on these generated files, no indication is given that the property on the derived type is hiding the property on the base type.
Regression
No response
Steps to reproduce
The following code should demonstrate the problem:
public class TypeA : ObservableObject
{
[ObservableProperty]
private bool _someField; // will generate TypeA.SomeField
}
public class TypeB : TypeA
{
[ObservableProperty]
private bool _someField; // will generate TypeB.SomeField, hiding TypeA.SomeField
}
Expected behavior
Some indication should be given that TypeB._someField causes hiding of the property generated for TypeA, either CS0108 on the field or some MVVM specific warning that explains exactly what is happening.
Screenshots
No response
IDE and version
VS 2022
IDE version
17.13.6
Nuget packages
- CommunityToolkit.Common
- CommunityToolkit.Diagnostics
- CommunityToolkit.HighPerformance
- CommunityToolkit.Mvvm (aka MVVM Toolkit)
Nuget package version(s)
8.4.0
Additional context
No response
Help us help you
No, just wanted to report this
- 主要言語
- C#
- スター
- 3.8k
- フォーク
- 401
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
CommunityToolkit/dotnet のほかの issue
-
RelayCommand<T>.CanExecute(null) returns false for value types without a predicate対応中かも @apachezy が 84 日前に担当しました。 オープンbug :bug:
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
CommunityToolkit/dotnet#1206 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
CommunityToolkit/dotnet#1186 ·
-
bug :bug:
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
CommunityToolkit/dotnet#648 ·
-
bug :bug:
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
CommunityToolkit/dotnet#1215 ·
-
Add segmented buffering and sequence reads to `ArrayPoolBufferWriter<T>`対応中かも @paulomorgado が 21 日前に担当しました。 オープンfeature request :mailbox_with_mail:
難易度 5/5 1週間以上 初心者へのやさしさ 45/100
CommunityToolkit/dotnet#1214 ·
CommunityToolkit/dotnet の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
nightscout/nocturne#2135 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
Devolutions/UniGetUI#5541 ·
メンテナーはふだん 1 日以内に返信
-
agentic-workflows Needs: Triage :mag:
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
[誤判定]オープンlinux アプリ: ブラウザー 再現済み 要トリアージ 誤判定
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
yksr-melt/Meltype#853 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信