Skip to content

Clarification: interaction between @property and @final #2336

Description

@yangdanny97

The spec for @final says:

The method decorator version may be used with all of instance methods, class methods, static methods, and properties.

and it made me wonder how exactly final interacts with property. There are no conformance tests exercising this specific interaction.

From carefully reading the spec, it seems like the only effect of @final on a property is to prevent it from being overridden in a child class, and that decorating a property with @final does not cause it to be read-only or disallow a setter.

Is my understanding correct? If so, does it make sense to add a clarification to the spec that the decorator does not make a property read-only?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions