Propоsal: Allow simultaneous use of this (...) and base (...) when creating a class constructor #1798
-
Example:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I don't think I like that adding Also, I'm not sure there's a good way to represent this in IL: when |
Beta Was this translation helpful? Give feedback.
-
A constructor must either call a base constructor or another constructor on the current class. It cannot call both as the base constructor must only be called once. You can very easily solve your problem above with some minor refactoring. More complicated examples can be solved through helper methods. |
Beta Was this translation helpful? Give feedback.
A constructor must either call a base constructor or another constructor on the current class. It cannot call both as the base constructor must only be called once.
You can very easily solve your problem above with some minor refactoring. More complicated examples can be solved through helper methods.