Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.

no-redeclare throws errors on overloaded functions #402

Closed
j-f1 opened this issue Oct 26, 2017 · 2 comments
Closed

no-redeclare throws errors on overloaded functions #402

j-f1 opened this issue Oct 26, 2017 · 2 comments

Comments

@j-f1
Copy link
Contributor

j-f1 commented Oct 26, 2017

What version of TypeScript are you using?

2.5.3

What version of typescript-eslint-parser are you using?

8.0.0

What code were you trying to parse?

export async function readFile(
  filename: string,
  options?: { flag?: string }
): Promise<Buffer>
export async function readFile(
  filename: string,
  options?: { encoding: BufferEncoding; flag?: string }
): Promise<string>
export async function readFile(
  filename: string,
  options?: { encoding?: string; flag?: string }
): Promise<Buffer | string> {
  // ...
}

What did you expect to happen?

No errors — readFile is only declared once.

What happened?

'readFile' is already defined.
@JamesHenry
Copy link
Member

We should hopefully be able to solve this with upcoming custom Referencer work

@JamesHenry
Copy link
Member

This was finally fixed by #412. I added the source above as an integration test.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants