mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
40 lines
731 B
TypeScript
40 lines
731 B
TypeScript
//// [tests/cases/compiler/errorElaboration.ts] ////
|
|
|
|
//// [errorElaboration.ts]
|
|
// 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;
|
|
declare 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;
|
|
|
|
|
|
//// [errorElaboration.js]
|
|
"use strict";
|
|
// Repro for #5712
|
|
foo(a);
|
|
// Repro for #25498
|
|
function test() {
|
|
return { foo: "bar" };
|
|
}
|
|
// Repro for #32358
|
|
const foo = { bar: 'a' };
|
|
const x = ({ [foo.bar]: c }) => undefined;
|