Skip to content

Question: is it intentional that the Future class cannot be extended? #24335

@evanweible-wf

Description

@evanweible-wf

To clarify, you can extend the Future abstract class, but the implementation lives in _Future and type checks are made against that private class. This means that attempting to extend Future does not work with methods using the async keyword since the custom future will not be recognized as a _Future and will then be wrapped in one.

I've seen a similar issue about extending types here: #3888
I understand that there are a list of types that cannot be subclassed for efficiency reasons - is Future one of them? If so, is there any chance that would change?

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-core-librarySDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.library-async

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions