TypeScript/tests/cases/compiler/errorElaboration.ts

24 lines
423 B
TypeScript
Raw Normal View History

2015-11-23 22:21:51 +01:00
// Repro for #5712
interface Ref<T> {
prop: T;
}
interface Container<T> {
m1: Container<Ref<T>>;
m2: T;
}
declare function foo(x: () => Container<Ref<number>>): void;
let a: () => Container<Ref<string>>;
foo(a);
// Repro for #25498
function test(): {[A in "foo"]: A} {
return {foo: "bar"};
}
// Repro for #32358
const foo = { bar: 'a' };
const x = ({ [foo.bar]: c }) => undefined;