fable-compiler / ts2fable

Parser of Typescript declaration files
http://fable.io/ts2fable/
Apache License 2.0
223 stars 34 forks source link

Fix: Duplicated Method in generated Interface when TS has duplicated method #464

Closed Booksbaum closed 1 year ago

Booksbaum commented 1 year ago
const node: {
  (arg: string): boolean
  (arg: string): boolean
}

currently produces:

type [<AllowNullLiteral>] IExportsNode =
    [<Emit("$0($1...)")>] abstract Invoke: arg: string -> bool
    [<Emit("$0($1...)")>] abstract Invoke: arg: string -> bool

-> error:

Duplicate method. The method 'Invoke' has the same name and signature as another method in type '[...].IExportsNode'.

In other cases duplicated methods already get reduced -- but here that didn't happen