Skip to content

VSTHRD012 wrongly reported on private/internal members #1111

@Nefarion

Description

@Nefarion

Bug description

VSTHRD012 gets reported if there is a private overload of a method with a JTF parameter.

Repro steps

static class Extensions
{
    public static void OnMainThread(Action action) => OnMainThread(Factory, action);
    
    private static void OnMainThread(JoinableTaskFactory factory, Action action) => factory.Run(async delegate
    {
        await Factory.SwitchToMainThreadAsync();
        action();
    });
}

From anywhere else:

Extensions.OnMainThread(() => { }) // <- this will report VSTHRD012

Expected behavior

No VSTRHD012 reported

Actual behavior

VSTHRD012 gets reported.

  • Version used: 17.4.27

Additional context

Changing the name of the private method to something other than the name of the public method fixes VSTHRD012

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions