© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Search
Star
Feedback
Setup for Free
Why is the struct allowed but the class isn't? - C#
C
C#
•
16mo ago
•
41 replies
ElectricTortoise
Why is the struct allowed but the class isn't?
The error is CS8618
- Non
-nullable variable must contain a non
-null value when exiting constructor
. Consider declaring it as nullable
.
The struct is readonly if that matters
.
C#
Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
62,470
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Similar Threads
Was this page helpful?
Yes
No
Recent Announcements
Similar Threads
❔ Struct vs Class
C
C# / help
3y ago
Why `where T: class`
C
C# / help
2y ago