Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Support implicit protected setter for get only properties #1986

Open
jayrulez opened this issue May 24, 2024 · 1 comment
Open

Comments

@jayrulez
Copy link
Contributor

The code below works in C#:

abstract class Parent
{
    public abstract int Number { get; }
}

class Child : Parent
{
    public override int Number { get; }

    public Child()
    {
        Number = 0;
    }
}

The code below does not compile in Beef:

abstract class Parent
{
    public abstract int Number { get; }
}

class Child : Parent
{
    public override int Number { get; }

    public this()
    {
        Number = 0;
    }
}

The Beef compiler complains that: Property has no setter

@UserMist
Copy link

I don't find it useful. Why wouldn't you specify a private setter? Having an exception to rules like that for constructors only is honestly a weird practice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants