You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tests/cases/compiler/errorElaboration.ts(12,5): error TS2345: Argument of type '() => Container<Ref<string>>' is not assignable to parameter of type '() => Container<Ref<number>>'.
2
3
Type 'Container<Ref<string>>' is not assignable to type 'Container<Ref<number>>'.
3
4
Type 'Ref<string>' is not assignable to type 'Ref<number>'.
4
5
Type 'string' is not assignable to type 'number'.
5
6
tests/cases/compiler/errorElaboration.ts(17,11): error TS2322: Type '"bar"' is not assignable to type '"foo"'.
@@ -16,6 +20,8 @@ tests/cases/compiler/errorElaboration.ts(17,11): error TS2322: Type '"bar"' is n
16
20
m2: T;
17
21
}
18
22
declare function foo(x: () => Container<Ref<number>>): void;
23
+
~~~
24
+
!!! error TS2300: Duplicate identifier 'foo'.
19
25
let a: () => Container<Ref<string>>;
20
26
foo(a);
21
27
~
@@ -32,4 +38,15 @@ tests/cases/compiler/errorElaboration.ts(17,11): error TS2322: Type '"bar"' is n
32
38
!!! error TS2322: Type '"bar"' is not assignable to type '"foo"'.
33
39
!!! related TS6500 tests/cases/compiler/errorElaboration.ts:16:18: The expected type comes from property 'foo' which is declared here on type '{ foo: "foo"; }'
34
40
}
41
+
42
+
// Repro for #32358
43
+
44
+
const foo = { bar: 'a' };
45
+
~~~
46
+
!!! error TS2300: Duplicate identifier 'foo'.
47
+
const x = ({ [foo.bar]: c }) => undefined;
48
+
~~~~~~~
49
+
!!! error TS2538: Type 'any' cannot be used as an index type.
50
+
~~~
51
+
!!! error TS2339: Property 'bar' does not exist on type '(x: () => Container<Ref<number>>) => void'.
0 commit comments