Replies: 2 comments 3 replies
-
A primary parameter is none of the things mentioned in the error message, so the error message is accurate. The error message doesn't list things that are valid; that would be a very long list. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The message currently looks like
CS0236 A field initializer cannot reference the non-static field, method, or property ....
However, this is not true anymore:
Value
is indeed a non-static member, that might or might not be initialized at that point.However, in the following scenario, there is no error, as the primary constructor will initialize
Value
ahead of that statement.But, the message does not include this scenario as an exception to the rule.
Beta Was this translation helpful? Give feedback.
All reactions