TypeScript/tests/baselines/reference/namedImportNonExistentName.types
Sheetal Nandi 9c60d5a4d3
Dont look for properties of Object and Function type when looking to resolve named import from module with export= (#37964)
* Add tests

* Dont look at object or function type when looking for members of `export=` type to be resolved by named imports
Fixes #37165

* Create separate cache when skipping function and object property augmentation

* Lookup in both cache if not skipObjectFunctionPropertyAugment
2020-11-03 12:22:30 -08:00

47 lines
854 B
Plaintext

=== tests/cases/compiler/foo.d.ts ===
export = Foo;
>Foo : typeof Foo
export as namespace Foo;
>Foo : typeof Foo
declare namespace Foo {
>Foo : typeof Foo
function foo();
>foo : () => any
}
=== tests/cases/compiler/foo2.ts ===
let x: { a: string; c: string; } | { b: number; c: number; };
>x : { a: string; c: string; } | { b: number; c: number; }
>a : string
>c : string
>b : number
>c : number
export = x
>x : { a: string; c: string; } | { b: number; c: number; }
=== tests/cases/compiler/bar.ts ===
import { Bar, toString, foo } from './foo';
>Bar : any
>toString : any
>foo : () => any
foo();
>foo() : any
>foo : () => any
import { a, b, c, d, toString as foo2String } from './foo2';
>a : any
>b : any
>c : string | number
>d : any
>toString : any
>foo2String : any
c;
>c : string | number