microsoft / TypeScript

TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
https://www.typescriptlang.org
Apache License 2.0
99.49k stars 12.33k forks source link

Rename inconsistency for default exports #11308

Open ghost opened 7 years ago

ghost commented 7 years ago

TypeScript Version: nightly (2.1.0-dev.20161002)

Code

a.ts
function f() {}
export default f
b.ts
import f from "./a"
f()

Expected behavior:

Renaming f in a.ts will rename the use in b.ts.

Actual behavior:

It doesn't. However, it does if a.ts is written as:

export default function f() {}
Andarist commented 11 months ago

I retested this in VS Code and it does seem to work - regardless of the renamed location in a.ts. cc @jakebailey

jakebailey commented 11 months ago

I tried to bisect this and failed; a test would probably be worthwhile if one's not immediately found. I didn't really find one, or a particular commit in the release this was fixed in to suggest it's tested.