dotnet/roslyn

Properties with inaccesible access methods shouldn't be visible

開放

#71,363 建立於 2023年12月19日

 (5 則留言) (0 個反應) (0 位負責人)C# (4,257 個分叉)batch import
Area-IDEIntelliSense-Completionhelp wanted

倉庫指標

星標
 (20,414 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

Steps to Reproduce: Define property like

public Predicate<T>? Selector { protected get; init; }

or even without get method,

Expected Behavior: It shouldn't show by IDE in cases where you can't call these accessors.

Actual Behavior: This member is always visible.

Also, CA1044 diagnostic interpreted as warning by default looks bit annoying. I suggest to interpret it like suggestion by default.

貢獻者指南