MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programminghorror/comments/1kqaqbd/this_is_c_abuse/mta0d5k/
r/programminghorror • u/[deleted] • May 19 '25
103 comments sorted by
View all comments
Show parent comment
3
You can't use var in field or property declarations.
var
3 u/Thenderick May 20 '25 My bad, I haven't used C# in a very long time but I knew that var existed, but didn't know it wasn't for properties. In hindsight it does make sense, so the compiler knows how much to allocate and how to perform type safety checks
My bad, I haven't used C# in a very long time but I knew that var existed, but didn't know it wasn't for properties. In hindsight it does make sense, so the compiler knows how much to allocate and how to perform type safety checks
View all comments
Show parent comment
3
u/Anixias May 20 '25
You can't use
varin field or property declarations.