permit global augmentations to introduce new names#8104
Conversation
| @@ -15596,6 +15596,9 @@ namespace ts { | |||
| case SyntaxKind.InterfaceDeclaration: | |||
| case SyntaxKind.ModuleDeclaration: | |||
| case SyntaxKind.TypeAliasDeclaration: | |||
There was a problem hiding this comment.
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: stringIt 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