Skip to content

Fully resolve aliases when checking symbol flags#50853

Merged
andrewbranch merged 9 commits intomicrosoft:mainfrom
andrewbranch:bug/44896
Sep 29, 2022
Merged

Fully resolve aliases when checking symbol flags#50853
andrewbranch merged 9 commits intomicrosoft:mainfrom
andrewbranch:bug/44896

Conversation

@andrewbranch
Copy link
Member

@andrewbranch andrewbranch commented Sep 19, 2022

Fixes #44896
Fixes #50455

I actually don’t think this is a breaking change in any meaningful way. I do have one test that exhibits new errors, but the scenario is extremely contrived and didn’t exactly work before. Mostly, this removes false errors and false import elisions. The most visible and understandable example is the one from #44896:

// @filename: constants.ts
export const COFFEE = 0;
export const TEA = 1;


// @filename: drink.ts
export type Drink = 0 | 1;
export * as Drink from "./constants";


// @filename: index.ts
import { Drink } from "./drink";
// 👀 BEFORE: 'Drink' only refers to a type, but is being used as a value here
// 👍 AFTER: No error
const x: Drink = Drink.TEA;

Loading
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Author: Team For Milestone Bug PRs that fix a bug with a specific milestone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When aliases and local declarations merge, basically nothing works export * as X cannot be imported when type X is exported

5 participants