© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
25 replies
Gladiator

Is there any reason why comparing struct types with null does not result in compile error?

When comparing struct types with null, it is always false. So, why doesn't the compiler throw compilation error?
When and where do we want to compare struct types with null?! never because it is a logical bug
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

Comparing types when using reflection
C#CC# / help
4y ago
✅ What is reason of null! here?
C#CC# / help
2y ago
Is there any reason I should not use Winforms NotifyIcon on windows with maui?
C#CC# / help
2y ago