TypeScript/tests/baselines/reference/namespaceMergedWithImportAliasNoCrash.types
Anders Hejlsberg a4f9bf0fce
Create type aliases for unresolved type symbols (#45976)
* Create type aliases for unresolved type symbols

* Accept new baselines

* Update fourslash tests

* Unresolved import aliases create tagged unresolved symbols

* Add comments

* Accept new baselines

* Add fourslash tests
2021-09-23 13:21:27 -07:00

39 lines
694 B
Plaintext

=== tests/cases/compiler/file1.ts ===
export namespace Library {
export type Bar = { a: number };
>Bar : Bar
>a : number
}
var x: Library.Bar; // should work
>x : Library.Bar
>Library : any
Library.foo; // should be an error
>Library.foo : any
>Library : any
>foo : any
=== tests/cases/compiler/file2.ts ===
import * as Lib from './file1';
>Lib : typeof Lib
namespace Lib { // should fail to merge
>Lib : typeof Lib
export const foo: string = "";
>foo : string
>"" : ""
}
Lib.foo; // should work
>Lib.foo : string
>Lib : typeof Lib
>foo : string
var x: Lib.Bar; // should be an error
>x : Lib.Bar
>Lib : any
export { Lib }
>Lib : typeof Lib