Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Emit VSTHRD003 warning when awaiting on foreign tasks from properties - #1244

#1244
Merged
AArnott merged 1 commit into
microsoft:mainmicrosoft/vs-threading:mainfrom
AArnott:fix1224AArnott/vs-threading:fix1224Copy head branch name to clipboard
Oct 24, 2023
Merged

Emit VSTHRD003 warning when awaiting on foreign tasks from properties#1244
AArnott merged 1 commit into
microsoft:mainmicrosoft/vs-threading:mainfrom
AArnott:fix1224AArnott/vs-threading:fix1224Copy head branch name to clipboard

Conversation

@AArnott

@AArnott AArnott commented Oct 23, 2023

Copy link
Copy Markdown
Member

Fixes #1224

if (symbol is IFieldSymbol field)
{
// Allow the TplExtensions.CompletedTask and related fields.
if (field.ContainingType.Name == Types.TplExtensions.TypeName && field.BelongsToNamespace(Types.TplExtensions.Namespace) &&

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

both this and the conditional on 88 are a little bit difficult to grok based on initial read. Consider making a method with a descriptive name to make it easier to understand at a glance.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree it is. I have a code comment above that explains it, and this is the method that keeps things simple for the caller. :)

@AArnott
AArnott merged commit 3920e97 into microsoft:main Oct 24, 2023
@AArnott
AArnott deleted the fix1224 branch October 24, 2023 19:09
@AArnott AArnott added this to the v17.9 milestone Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VSTHRD003 should fire when awaiting on TCS.Task

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.