Language: Dart doesn't allow final class

Created on 27 May 2020  路  3Comments  路  Source: dart-lang/language

Description:
Effective dart guidelines mention the following.
AVOID extending a class that isn鈥檛 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

feature

Most helpful comment

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

https://github.com/dart-lang/language/issues/349 is a related issue.

All 3 comments

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

https://github.com/dart-lang/language/issues/349 is a related issue.

see also #11

Was this page helpful?
0 / 5 - 0 ratings

Related issues

listepo picture listepo  路  3Comments

eernstg picture eernstg  路  5Comments

munificent picture munificent  路  5Comments

leonsenft picture leonsenft  路  4Comments

marcelgarus picture marcelgarus  路  3Comments