© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
18 replies
swagrid

✅ Roslyn analyzer: System.Guid only has _dummyPrimitive field?

I'm currently writing an analyzer that inspects the fields of certain types. One of the tests failed because it analyzed
System.Guid
System.Guid
and I noticed that, according to this query:
ITypeSymbol type = ... // type is Guid
type.GetMembers().OfType<IFieldSymbol>().Where(f => !f.IsStatic)
ITypeSymbol type = ... // type is Guid
type.GetMembers().OfType<IFieldSymbol>().Where(f => !f.IsStatic)

System.Guid
System.Guid
only has a single field:
int _dummyPrimitive
int _dummyPrimitive
. I know that guids are larger than 4 bytes and given the field name, I assume this is a placeholder of some sort. I could just ignore
System.Guid
System.Guid
but I suspect this is not the only type that behaves this way.

1. Why is the
ITypeSymbol
ITypeSymbol
of
System.Guid
System.Guid
a placeholder (or whatever this is) and not the original definition?
2. Can I somehow detect when a type is a placeholder?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Rider - Custom Roslyn Analyzer
C#CC# / help
3mo ago
❔ Roslyn analyzer rules extraction
C#CC# / help
3y ago
Rider Roslyn Analyzer Not Working (Partially)
C#CC# / help
9mo ago
❔ Roslyn analyzer test project can't compile `where T : unmanaged` type constraint
C#CC# / help
3y ago