Properties generated from private fields do not conflict/trigger CS0108 or any other warning
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Bắt đầu từ phần triển khai source-generator của ObservableProperty và tìm các kiểm thử chẩn đoán hoặc cảnh báo của nó, sau đó tái hiện ví dụ TypeA/TypeB từ issue. Xác định cách các thuộc tính được tạo từ các trường private được kiểm tra qua quan hệ kế thừa, và coi trường hợp được báo cáo là hoàn tất khi nó tạo ra một chẩn đoán rõ ràng về việc che khuất, chẳng hạn như CS0108, hoặc một cảnh báo dành riêng cho MVVM.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- C#
- Star
- 3.8k
- Fork
- 401
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của CommunityToolkit/dotnet
-
RelayCommand<T>.CanExecute(null) returns false for value types without a predicateCó thể đã có người làm @apachezy đã nhận 85 ngày trước. Đang mởbug :bug:
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
CommunityToolkit/dotnet#1206 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
CommunityToolkit/dotnet#1186 ·
-
bug :bug:
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
CommunityToolkit/dotnet#648 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
CommunityToolkit/dotnet#1217 ·
-
bug :bug:
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
CommunityToolkit/dotnet#1215 ·
Tất cả issue của CommunityToolkit/dotnet
Issue tương tự
-
Backend enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
UI: money shows the minus sign next to the number, not before the currency (IL -3.0m, not -IL 3.0m)Đang mởarea: sim area: unity enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
eyalgolan/statecraft-israel#1107 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
dimitar-radenkov/Pointframe#271 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
qew21/Genshin-Subtitles#45 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
HoffmanEngineering/3d-print-log-api#274 ·
Maintainer thường phản hồi trong vòng 1 ngày