Skip to content

Function from class to class #3915

@futpib

Description

@futpib

How do I properly annotate the following code?

const AMixin = superclass => class extends superclass {
  aMixedMethod() {}
}

const ABMixin = superclass => class extends AMixin(superclass) {
  bMixedMethod() {}
}

export {
  AMixin,
  ABMixin,
};

This example on flow.org/try.

Analogous code without exports works fine with inferred types (example), but I am not sure what the inferred signature is or how to get it or whether it is possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions