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

Dart doesn't allow final class #987

Open
dev-aentgs opened this issue May 27, 2020 · 3 comments
Open

Dart doesn't allow final class #987

dev-aentgs opened this issue May 27, 2020 · 3 comments
Labels
feature Proposed language feature that solves one or more problems

Comments

@dev-aentgs
Copy link

Description:
Effective dart guidelines mention the following.
AVOID extending a class that isn’t intended to be subclassed.

Like in java, in this case allowing the class to be marked as final would prevent another class from inheriting it, dart doesn't allow final class.
What would be the side effects if this was allowed?
Would this be a breaking change?

effective dart #2440

@dev-aentgs dev-aentgs added the feature Proposed language feature that solves one or more problems label May 27, 2020
@srawlins
Copy link
Member

We do have a @sealed annotation for the present. But it's not a hard language feature, just for static analysis.

#349 is a related issue.

@Cat-sushi
Copy link

see also #11

@kevmoo
Copy link
Member

kevmoo commented Jun 17, 2020

See proposed solution at #704

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Proposed language feature that solves one or more problems
Projects
None yet
Development

No branches or pull requests

4 participants