TypeScript/tests/cases/compiler/uniqueSymbolAssignmentOnGlobalAugmentationSuceeds.ts

13 lines
228 B
TypeScript
Raw Normal View History

2019-04-18 00:13:09 +02:00
// @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;
}