Closed
Description
// tsconfig.json
{
"compilerOptions": {
"target": "esnext",
"module": "nodenext",
"strict": true,
"noEmit": true,
"baseUrl": ".",
"paths": {
"@oops/*": ["./a.js"],
"@oops/*/y": ["./b.js"],
"@oops/*/y/x": ["./c.js"],
}
},
}
// @filename: main.ts
import * as Oops from "@oops/z/y/x";
let value: number = Oops.value;
// @filename: a.ts
export let value = 1;
// @filename: b.ts
export let value = true;
// @filename: c.ts
export let value = "hello!";
If you compile this, it will not always end up with a consistent result. Sometimes it succeeds, and sometimes it fails:
main.ts:4:5 - error TS2322: Type 'string' is not assignable to type 'number'.
4 let value: number = Oops.value;
~~~~~
Found 1 error in main.ts:4