Consider this example:
import { Promise as MyPromise } from './file1';
export function f(p1: Promise<void>, p2: MyPromise<void>): void {
// p1 is using the ambient Promise from the compiler runtime
// p2 is using the declaration from file1, which happens to use the same name "Promise"
// in that file
}
In the .d.ts rollup, p1 and p2 accidentally end up with the same type:
declare class Promise<T> {
private x;
}
export declare function f(p1: Promise<void>, p2: Promise<void>): void;
This happens because the algorithm doesn't realize that Promise is a global name introduced by lib.es2015.promise.d.ts, which comes in via this part of tsconfig.json:
"lib": [
"es5",
"scripthost",
"es2015.collection",
"es2015.promise",
"es2015.iterable",
"dom"
],
This is breaking @microsoft/sp-application-base.
@iclanton