Merge pull request #15258 from Microsoft/mergeSymbol-uses-first-decl-not-valueDecl
mergeSymbol uses first declaration, not valueDeclaration
This commit is contained in:
commit
a8593996f9
|
@ -574,7 +574,7 @@ namespace ts {
|
|||
recordMergedSymbol(target, source);
|
||||
}
|
||||
else if (target.flags & SymbolFlags.NamespaceModule) {
|
||||
error(source.valueDeclaration.name, Diagnostics.Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity, symbolToString(target));
|
||||
error(source.declarations[0].name, Diagnostics.Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity, symbolToString(target));
|
||||
}
|
||||
else {
|
||||
const message = target.flags & SymbolFlags.BlockScopedVariable || source.flags & SymbolFlags.BlockScopedVariable
|
||||
|
|
12
tests/baselines/reference/noSymbolForMergeCrash.errors.txt
Normal file
12
tests/baselines/reference/noSymbolForMergeCrash.errors.txt
Normal file
|
@ -0,0 +1,12 @@
|
|||
tests/cases/compiler/final.ts(1,6): error TS2649: Cannot augment module 'A' with value exports because it resolves to a non-module entity.
|
||||
|
||||
|
||||
==== tests/cases/compiler/initial.ts (0 errors) ====
|
||||
interface A { }
|
||||
namespace A {}
|
||||
|
||||
==== tests/cases/compiler/final.ts (1 errors) ====
|
||||
type A = {}
|
||||
~
|
||||
!!! error TS2649: Cannot augment module 'A' with value exports because it resolves to a non-module entity.
|
||||
|
12
tests/baselines/reference/noSymbolForMergeCrash.js
Normal file
12
tests/baselines/reference/noSymbolForMergeCrash.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
//// [tests/cases/compiler/noSymbolForMergeCrash.ts] ////
|
||||
|
||||
//// [initial.ts]
|
||||
interface A { }
|
||||
namespace A {}
|
||||
|
||||
//// [final.ts]
|
||||
type A = {}
|
||||
|
||||
|
||||
//// [initial.js]
|
||||
//// [final.js]
|
6
tests/cases/compiler/noSymbolForMergeCrash.ts
Normal file
6
tests/cases/compiler/noSymbolForMergeCrash.ts
Normal file
|
@ -0,0 +1,6 @@
|
|||
// @Filename: initial.ts
|
||||
interface A { }
|
||||
namespace A {}
|
||||
|
||||
// @Filename: final.ts
|
||||
type A = {}
|
Loading…
Reference in a new issue