-
Notifications
You must be signed in to change notification settings - Fork 13k
permit global augmentations to introduce new names #8104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -15596,6 +15596,9 @@ namespace ts { | |||
case SyntaxKind.InterfaceDeclaration: | |||
case SyntaxKind.ModuleDeclaration: | |||
case SyntaxKind.TypeAliasDeclaration: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's also a case for import =
declarations above that reports this error in global module augmentations.
0f323ea also fixes asymmetry that we currently have: in ambient namespaces without explicitly exported declarations all entities were considered exported except imports. This is technically a breaking change in following scenario however I have no idea what this code might do in the first place declare namespace A.B {
let x: number;
}
declare namespace M {
import X = A.B.x;
let X: string;
}
M.X // refers to let X: string It is only an issue in ambient case - non-ambient version correctly yields error about colliding declarations. |
Can you run definitely typed tests on this change and see if there are any new errors? i have definitely seen this pattern in the past. |
revering back since it breaks the following case: declare module "A" {
import X = A.B.C
let y = X.M1;
}
declare module "A" {
import X = A.B.C
let z = X.M2;
} |
@mhegazy any other comments? |
👍 |
fixes #8102