Allow set to override and implement init #4031
Unanswered
YairHalberstadt
asked this question in
Language Ideas
Replies: 2 comments 4 replies
-
I like this proposal and it solves all problems of #4030 that I have. Do I understand correctly that following code would be legal? public class Base
{
public abstract int P { get; init; }
}
public class Derived : Base
{
public void SetP() => P = 42;
public override int P { get; private set; }
} var d = new Derived
{
P = 42
};
d.SetP(); |
Beta Was this translation helpful? Give feedback.
3 replies
-
Currently, class This proposal would break that invariant. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The following scenarios should be legal:
Beta Was this translation helpful? Give feedback.
All reactions