-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
csharp_style_var_when_type_is_apparent breaks when awaiting a generic type #64902
Comments
@CyrusNajmabadi @sharwell Before I triage out: does this request match your expectation for what "is apparent" is supposed to do here? I know it's not as well specced as we'd like... |
Neither of these cases seem apparant to me. THere's nothing on the RHS that makes me understand what the type should be. |
@CyrusNajmabadi That was my thought, but wasn't sure if there was some funky logic here. |
Closing out as by design. These cases are not apparent. |
@CyrusNajmabadi closing this as "by design" because "these cases are not apparent" appears like a misunderstanding of the bug report. It is agreed that all 4 cases are "not apparent." The issue is the linter thinks |
Indeed. Reactivated |
Version Used: net6.0, netcoreapp3.1
Summary:
When specifying
csharp_style_var_when_type_is_apparent: true
, the formatter thinksawait Task.Run(() => SomeMethodThatReturnsAGenericallyTypedResult())
's type is "apparent" andawait
ing the value forces you to usevar
Steps to Reproduce:
.editorconfig
whose content isProgram.cs
, paste the following code:Expected Behavior:
All four of the variables should require specifying the type, yielding no warnings in the above code.
Actual Behavior:
test4
's type has a warning that says it should usevar
:The text was updated successfully, but these errors were encountered: