TypeScript/tests/cases/compiler/uniqueSymbolAssignmentOnGlobalAugmentationSuceeds.ts
2019-04-17 15:13:09 -07:00

13 lines
228 B
TypeScript

// @strict: true
// @target: es6
const FOO_SYMBOL = Symbol('Foo');
declare global {
interface Promise<T> {
[FOO_SYMBOL]?: number;
}
}
export function foo<T>(p: Promise<T>) {
p[FOO_SYMBOL] = 3;
}