mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
104 lines
5.8 KiB
Plaintext
104 lines
5.8 KiB
Plaintext
computedPropertiesInDestructuring1.ts(3,7): error TS2537: Type '{ bar: string; }' has no matching index signature for type 'string'.
|
|
computedPropertiesInDestructuring1.ts(8,7): error TS2537: Type '{ bar: string; }' has no matching index signature for type 'string'.
|
|
computedPropertiesInDestructuring1.ts(10,8): error TS2537: Type '{ bar: string; }' has no matching index signature for type 'string'.
|
|
computedPropertiesInDestructuring1.ts(11,8): error TS2537: Type '{ bar: string; }' has no matching index signature for type 'string'.
|
|
computedPropertiesInDestructuring1.ts(14,15): error TS2537: Type '{ bar: number; }' has no matching index signature for type 'string'.
|
|
computedPropertiesInDestructuring1.ts(15,15): error TS2537: Type '{ bar: number; }' has no matching index signature for type 'string'.
|
|
computedPropertiesInDestructuring1.ts(16,16): error TS2537: Type '{ bar: number; }' has no matching index signature for type 'string'.
|
|
computedPropertiesInDestructuring1.ts(17,16): error TS2537: Type '{ bar: number; }' has no matching index signature for type 'string'.
|
|
computedPropertiesInDestructuring1.ts(20,8): error TS2349: This expression is not callable.
|
|
Type 'String' has no call signatures.
|
|
computedPropertiesInDestructuring1.ts(20,8): error TS2538: Type 'any' cannot be used as an index type.
|
|
computedPropertiesInDestructuring1.ts(21,8): error TS2538: Type 'any' cannot be used as an index type.
|
|
computedPropertiesInDestructuring1.ts(21,12): error TS2339: Property 'toExponential' does not exist on type 'string'.
|
|
computedPropertiesInDestructuring1.ts(24,4): error TS2537: Type '{ bar: string; }' has no matching index signature for type 'string'.
|
|
computedPropertiesInDestructuring1.ts(28,4): error TS2537: Type '{ bar: string; }' has no matching index signature for type 'string'.
|
|
computedPropertiesInDestructuring1.ts(30,4): error TS2537: Type '{ bar: string; }' has no matching index signature for type 'string'.
|
|
computedPropertiesInDestructuring1.ts(31,4): error TS2537: Type '{ bar: string; }' has no matching index signature for type 'string'.
|
|
computedPropertiesInDestructuring1.ts(33,4): error TS2349: This expression is not callable.
|
|
Type 'String' has no call signatures.
|
|
computedPropertiesInDestructuring1.ts(33,4): error TS2538: Type 'any' cannot be used as an index type.
|
|
computedPropertiesInDestructuring1.ts(34,4): error TS2538: Type 'any' cannot be used as an index type.
|
|
computedPropertiesInDestructuring1.ts(34,5): error TS2365: Operator '+' cannot be applied to types 'number' and '{}'.
|
|
|
|
|
|
==== computedPropertiesInDestructuring1.ts (20 errors) ====
|
|
// destructuring in variable declarations
|
|
let foo = "bar";
|
|
let {[foo]: bar} = {bar: "bar"};
|
|
~~~
|
|
!!! error TS2537: Type '{ bar: string; }' has no matching index signature for type 'string'.
|
|
|
|
let {["bar"]: bar2} = {bar: "bar"};
|
|
|
|
let foo2 = () => "bar";
|
|
let {[foo2()]: bar3} = {bar: "bar"};
|
|
~~~~~~
|
|
!!! error TS2537: Type '{ bar: string; }' has no matching index signature for type 'string'.
|
|
|
|
let [{[foo]: bar4}] = [{bar: "bar"}];
|
|
~~~
|
|
!!! error TS2537: Type '{ bar: string; }' has no matching index signature for type 'string'.
|
|
let [{[foo2()]: bar5}] = [{bar: "bar"}];
|
|
~~~~~~
|
|
!!! error TS2537: Type '{ bar: string; }' has no matching index signature for type 'string'.
|
|
|
|
function f1({["bar"]: x}: { bar: number }) {}
|
|
function f2({[foo]: x}: { bar: number }) {}
|
|
~~~
|
|
!!! error TS2537: Type '{ bar: number; }' has no matching index signature for type 'string'.
|
|
function f3({[foo2()]: x}: { bar: number }) {}
|
|
~~~~~~
|
|
!!! error TS2537: Type '{ bar: number; }' has no matching index signature for type 'string'.
|
|
function f4([{[foo]: x}]: [{ bar: number }]) {}
|
|
~~~
|
|
!!! error TS2537: Type '{ bar: number; }' has no matching index signature for type 'string'.
|
|
function f5([{[foo2()]: x}]: [{ bar: number }]) {}
|
|
~~~~~~
|
|
!!! error TS2537: Type '{ bar: number; }' has no matching index signature for type 'string'.
|
|
|
|
// report errors on type errors in computed properties used in destructuring
|
|
let [{[foo()]: bar6}] = [{bar: "bar"}];
|
|
~~~
|
|
!!! error TS2349: This expression is not callable.
|
|
!!! error TS2349: Type 'String' has no call signatures.
|
|
~~~~~
|
|
!!! error TS2538: Type 'any' cannot be used as an index type.
|
|
let [{[foo.toExponential()]: bar7}] = [{bar: "bar"}];
|
|
~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2538: Type 'any' cannot be used as an index type.
|
|
~~~~~~~~~~~~~
|
|
!!! error TS2339: Property 'toExponential' does not exist on type 'string'.
|
|
|
|
// destructuring assignment
|
|
({[foo]: bar} = {bar: "bar"});
|
|
~~~
|
|
!!! error TS2537: Type '{ bar: string; }' has no matching index signature for type 'string'.
|
|
|
|
({["bar"]: bar2} = {bar: "bar"});
|
|
|
|
({[foo2()]: bar3} = {bar: "bar"});
|
|
~~~~~~
|
|
!!! error TS2537: Type '{ bar: string; }' has no matching index signature for type 'string'.
|
|
|
|
[{[foo]: bar4}] = [{bar: "bar"}];
|
|
~~~
|
|
!!! error TS2537: Type '{ bar: string; }' has no matching index signature for type 'string'.
|
|
[{[foo2()]: bar5}] = [{bar: "bar"}];
|
|
~~~~~~
|
|
!!! error TS2537: Type '{ bar: string; }' has no matching index signature for type 'string'.
|
|
|
|
[{[foo()]: bar4}] = [{bar: "bar"}];
|
|
~~~
|
|
!!! error TS2349: This expression is not callable.
|
|
!!! error TS2349: Type 'String' has no call signatures.
|
|
~~~~~
|
|
!!! error TS2538: Type 'any' cannot be used as an index type.
|
|
[{[(1 + {})]: bar4}] = [{bar: "bar"}];
|
|
~~~~~~~~
|
|
!!! error TS2538: Type 'any' cannot be used as an index type.
|
|
~~~~~~
|
|
!!! error TS2365: Operator '+' cannot be applied to types 'number' and '{}'.
|
|
|
|
|
|
|