-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Description
We have had a few reports spread across feedback tools. I'd like to create a specific issue to track the discussion and user impact. This is strongly related to discussion in #53078 and user feedbacks such as https://developercommunity.visualstudio.com/t/Incorrect-type-deduction-tooltip-for-var/
This is specifically on why we show string? in cases where using var is assigned from a string value. For example:
var x = "Split";
var splitString = x.ToString();This does not apply only to string, but any reference type assignment. Current IDE behavior is captured below:
A few important things about this issue:
- Method Returns string[] But var types as string[]? #53078 does a great job of the discussion on why the behavior exists, and the thought put into this as it adheres to language design. This is not a proposal to change the language design here, but rather how we as a tooling team can help users understand the design better.
- This will be a good issue for tracking any confusion/feature requests in this area. That way we can gauge user interest in wanting this feature for prioritization.
I will mark this as "Needs Proposal" to signify that there is not a clear design moving forward, and we will see track closely user feedback to help us prioritizing coming up with a design to help users.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
