facebookarchive / ide-flowtype

Flow support for Atom IDE
Other
178 stars 17 forks source link

Incorrect interfaces handling #34

Open akaRem opened 6 years ago

akaRem commented 6 years ago

Atom v 1.20.1 ide-flowtype 0.17.4

Sample document:

// @flow

export interface IEx1 {}
export interface IEx2 {}
export interface IEx3 extends IEx2 {
  method(): number;
}

export type TEx1 = string;
export type TEx2 = Class<$Subtype<IEx3>>;

export class CEx1 implements IEx2 {
  static a: string = "a";
  b: string = "a";
  constructor() {
    this.b = "b";
  }
  method() {
    return 1;
  }
}

Observed UI state:

2017-10-05 15 19 43

Expected UI features:

NOTE

I think that $Subtype is class because such construction is OK for flow and does not report any errors.

export const aListOfClsThatImplIEx3: Class<$Subtype<IEx3>>[] = [CEx1];