Skip to content

Clean up abstract classes that only contain static methods #9169

@kenzieschmoll

Description

@kenzieschmoll

Instead of

abstract class Foo {
  // only static members
}

We can use

extension Foo on Never {
  // only static members
}

Extensions are a bit more restricted (can't be implemented/extended etc), and don't create a real type (they disappear at runtime entirely) so they are technically cheaper. This will also allow us to remove several lint ignores of avoid_classes_with_only_static_members.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions