Replies: 2 comments
-
The type of variable Discussion with C# tooling belongs to dotnet/roslyn repo. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Yep, I stated "declaring my tuple explicitly"
Yep, that's the essence of what I suggested: "suggest changing the declaration to include the field name or to var" |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This was a headscratcher for me. I made the mistake of first declaring my tuple explicitely using types, and then providing field names in the projection, not realizing the field names need to be present in the declaration as well. But across method calls or in linq extensions I couldn't access the field names. I started wondering if tuple field names were something that were maybe lost when passed as parameters, and that it was just some syntax sugar that only worked in local contexts.
Consider an Options -> C# -> Code style configuration defaulted to Suggestion that will suggest changing the declaration to include the field name or to var, if it detects that a name field tuple is being assigned to a tuple without field names.
Beta Was this translation helpful? Give feedback.
All reactions