Skip to content

Core libraries: Remove defensive checks against subclasses of final classes #60513

Open
@lrhn

Description

@lrhn

Some code checks that incoming objects are not user-created subclasses of a public interface, even when the interface is marked final
(fx Zone code doing if (zone is! _Zone) throw ....).
That's necessary if the program contains pre-3.0 code, which can ignore final markers in platform libraries.

Most likely nobody is implementing the now final classes, and if they do, the code would break slightly later when it accesses a private memeber of the implementation class it assumes.

When Dart stops supporting pre-3.0 language versions, these tests can be removed.
(Quite possibly they can be removed sooner, and the only effect would be that things would crash in ugly ways if someone implemented Zone from a pre-3.0 library.)

This issue can be used as TODO-target for "remove this check when ..." comments.

Metadata

Metadata

Assignees

Labels

area-core-librarySDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.type-code-healthInternal changes to our tools and workflows to make them cleaner, simpler, or more maintainable

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions