Skip to content

Report error which Flow does not report #71

@pizzafroide

Description

@pizzafroide

This use case is where, in C/C++, a forward declaration would be needed.

A.js:

// @flow

import B from './B';

export default class A {
  a() { return new B(this); }
}

B.js:

// @flow

import type A from './A';

export default class B {
  a: A;

  constructor(a: A) {
    this.a = a;
  }
}

Flow says No errors! but flowtype-errors/show-errors reports the following in A.js:

6:23  A:  This type is incompatible with the expected param type of A. See ./B.js:8

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions