swagrid
swagrid
CC#
Created by swagrid on 7/10/2023 in #help
✅ Roslyn analyzer: System.Guid only has _dummyPrimitive field?
Will, do. I had issues last time where it didn't let me close the thread. Lets see if I'm mighty enough this time.
19 replies
CC#
Created by swagrid on 7/10/2023 in #help
✅ Roslyn analyzer: System.Guid only has _dummyPrimitive field?
Thanks a lot for the help!
19 replies
CC#
Created by swagrid on 7/10/2023 in #help
✅ Roslyn analyzer: System.Guid only has _dummyPrimitive field?
That was my idea as well. It shouldn't be too bad, since we don't use many types outside of our own namespace for marshaling. It's mainly primitives and two or three others like Guid.
19 replies
CC#
Created by swagrid on 7/10/2023 in #help
✅ Roslyn analyzer: System.Guid only has _dummyPrimitive field?
I have an analyzer for more complex types that checks for unmanaged (in generics, for example). This specific analyzer is there to flag parameters that are expected to be passed as a pointer. Basically, everything that doesn't fit in a register should be passed as a pointer in some form (e.g. in Guid param1). Since the unmanaged constraint is valid on larger types, I cannot use it here. I'm also aware that doesn't fit in a register is very hard to determine because of the marshaler, so I'm overly pessimistic in the analyzer (which is fine in our scenario).
19 replies
CC#
Created by swagrid on 7/10/2023 in #help
✅ Roslyn analyzer: System.Guid only has _dummyPrimitive field?
One part of the analyzer looks at the fields of a type to check if it's a wrapper of a primitive, e.g. struct Bool { byte b; }. That's where I ran into the Guid issue.
19 replies
CC#
Created by swagrid on 7/10/2023 in #help
✅ Roslyn analyzer: System.Guid only has _dummyPrimitive field?
We do quite extensive native interop between C# and C++ and I'm writing an analyzer that ensures we follow some internal guidelines when marshaling data. The analyzer effectively looks at all static extern methods and analyzes their parameters and return types.
19 replies
CC#
Created by swagrid on 7/10/2023 in #help
✅ Roslyn analyzer: System.Guid only has _dummyPrimitive field?
I see, can project references also resolve to reference assemblies?
19 replies
CC#
Created by swagrid on 6/18/2023 in #help
❔ Roslyn analyzer test project can't compile `where T : unmanaged` type constraint
This is sooo much better. Now I can delete this cursed helper.
25 replies
CC#
Created by swagrid on 6/18/2023 in #help
❔ Roslyn analyzer test project can't compile `where T : unmanaged` type constraint
🤷 maybe I've already missed it back then. Anyways thanks for the help
25 replies
CC#
Created by swagrid on 6/18/2023 in #help
❔ Roslyn analyzer test project can't compile `where T : unmanaged` type constraint
probably shouldn't have done that
25 replies
CC#
Created by swagrid on 6/18/2023 in #help
❔ Roslyn analyzer test project can't compile `where T : unmanaged` type constraint
Hmm, I've started using the analyzers basically when they were first introduced, and copy & pasted the testing for new analyzers from then
25 replies
CC#
Created by swagrid on 6/18/2023 in #help
❔ Roslyn analyzer test project can't compile `where T : unmanaged` type constraint
since when does the testing framework exist?
25 replies
CC#
Created by swagrid on 6/18/2023 in #help
❔ Roslyn analyzer test project can't compile `where T : unmanaged` type constraint
🙂
25 replies
CC#
Created by swagrid on 6/18/2023 in #help
❔ Roslyn analyzer test project can't compile `where T : unmanaged` type constraint
Should be largely copied from a sample project
25 replies
CC#
Created by swagrid on 6/18/2023 in #help
❔ Roslyn analyzer test project can't compile `where T : unmanaged` type constraint
This file is used to generate the compilation
25 replies
CC#
Created by swagrid on 6/18/2023 in #help
❔ Roslyn analyzer test project can't compile `where T : unmanaged` type constraint
That's what I'm suspecting as well, I had trouble with those in the past
25 replies
CC#
Created by swagrid on 6/18/2023 in #help
❔ Roslyn analyzer test project can't compile `where T : unmanaged` type constraint
and when building that source code during test execution, that build fails
25 replies
CC#
Created by swagrid on 6/18/2023 in #help
❔ Roslyn analyzer test project can't compile `where T : unmanaged` type constraint
each test is building some source code that is then analyzed by the analyzer
25 replies
CC#
Created by swagrid on 6/18/2023 in #help
❔ Roslyn analyzer test project can't compile `where T : unmanaged` type constraint
or rather, during execution of the tests
25 replies
CC#
Created by swagrid on 6/18/2023 in #help
❔ Roslyn analyzer test project can't compile `where T : unmanaged` type constraint
the test project
25 replies