facebookarchive/ide-flowtype

Incorrect interfaces handling

akaRem opened this issue · 0 comments

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:

  • interface definitions should appear in outline view
  • interface IEe1 should be listed as [interface IEx1] (same for IEx2 and IEx3) in completion list
  • <$Subtype<IEx3>> should be listed as [class <$Subtype<IEx3>>] in completion list
  • Class<$Subtype<IEx3>> should be listed as [type: [class <$Subtype<IEx3>>]] in completion list

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];