Skip to content
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

Structs not being recognized as MembersRequiringMainThread #456

Closed
mthalman opened this issue Jan 17, 2019 · 0 comments · Fixed by #869
Closed

Structs not being recognized as MembersRequiringMainThread #456

mthalman opened this issue Jan 17, 2019 · 0 comments · Fixed by #869

Comments

@mthalman
Copy link
Member

mthalman commented Jan 17, 2019

Bug description

I've defined my own vs-threading.MembersRequiringMainThread.txt file in my project and added a struct type to the file. When calling a member of that struct, no warning is being generated even though it should be violating the check.

Repro steps

public namespace MyProduct
{
    public struct MyStruct
    {
        public static void DoSomething()
        {
        }
    }
}

vs-threading.MembersRequiringMainThread.txt:
[MyProduct.MyStruct]

Calling code:

public void Test()
{
    MyProduct.MyStruct.DoSomething(); // Should produce warning
}

Expected behavior

The code that calls the struct's members should cause a VSTHRD010 warning if it hasn't guaranteed that it's executing on main thread.

Actual behavior

No warning occurs.

  • Version used:
  • Application (if applicable):

Additional context

Add any other context about the problem here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants