mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
fe0f97b699
Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: jakebailey <[email protected]>
286 lines
18 KiB
Plaintext
286 lines
18 KiB
Plaintext
error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration.
|
|
destructuringParameterDeclaration1ES5iterable.ts(12,4): error TS2345: Argument of type '[number, number, string[][], number]' is not assignable to parameter of type '[number, number, string[][]]'.
|
|
Source has 4 element(s) but target allows only 3.
|
|
destructuringParameterDeclaration1ES5iterable.ts(23,5): error TS7010: 'b5', which lacks return-type annotation, implicitly has an 'any' return type.
|
|
destructuringParameterDeclaration1ES5iterable.ts(23,8): error TS7006: Parameter 'z' implicitly has an 'any' type.
|
|
destructuringParameterDeclaration1ES5iterable.ts(23,11): error TS7006: Parameter 'y' implicitly has an 'any' type.
|
|
destructuringParameterDeclaration1ES5iterable.ts(23,17): error TS7031: Binding element 'a' implicitly has an 'any' type.
|
|
destructuringParameterDeclaration1ES5iterable.ts(23,20): error TS7031: Binding element 'b' implicitly has an 'any' type.
|
|
destructuringParameterDeclaration1ES5iterable.ts(23,25): error TS7031: Binding element 'p' implicitly has an 'any' type.
|
|
destructuringParameterDeclaration1ES5iterable.ts(23,33): error TS7031: Binding element 'q' implicitly has an 'any' type.
|
|
destructuringParameterDeclaration1ES5iterable.ts(23,36): error TS7031: Binding element 'r' implicitly has an 'any' type.
|
|
destructuringParameterDeclaration1ES5iterable.ts(29,5): error TS2322: Type 'number' is not assignable to type 'null | undefined'.
|
|
destructuringParameterDeclaration1ES5iterable.ts(29,8): error TS2322: Type 'number' is not assignable to type 'null | undefined'.
|
|
destructuringParameterDeclaration1ES5iterable.ts(29,11): error TS2322: Type 'number' is not assignable to type 'null | undefined'.
|
|
destructuringParameterDeclaration1ES5iterable.ts(30,4): error TS2345: Argument of type '"string"' is not assignable to parameter of type 'null | undefined'.
|
|
destructuringParameterDeclaration1ES5iterable.ts(31,4): error TS2345: Argument of type '"string"' is not assignable to parameter of type 'null | undefined'.
|
|
destructuringParameterDeclaration1ES5iterable.ts(32,5): error TS2322: Type 'string' is not assignable to type 'undefined'.
|
|
destructuringParameterDeclaration1ES5iterable.ts(32,15): error TS2322: Type 'number' is not assignable to type 'null'.
|
|
destructuringParameterDeclaration1ES5iterable.ts(32,18): error TS2322: Type 'number' is not assignable to type 'undefined'.
|
|
destructuringParameterDeclaration1ES5iterable.ts(33,6): error TS2322: Type 'string' is not assignable to type 'undefined'.
|
|
destructuringParameterDeclaration1ES5iterable.ts(33,17): error TS2322: Type 'number' is not assignable to type 'undefined'.
|
|
destructuringParameterDeclaration1ES5iterable.ts(33,22): error TS2322: Type 'true' is not assignable to type 'undefined'.
|
|
destructuringParameterDeclaration1ES5iterable.ts(33,28): error TS2322: Type 'false' is not assignable to type 'undefined'.
|
|
destructuringParameterDeclaration1ES5iterable.ts(38,18): error TS7031: Binding element 'x' implicitly has an 'any' type.
|
|
destructuringParameterDeclaration1ES5iterable.ts(38,25): error TS7031: Binding element 'j' implicitly has an 'any' type.
|
|
destructuringParameterDeclaration1ES5iterable.ts(42,14): error TS7031: Binding element 'a' implicitly has an 'any' type.
|
|
destructuringParameterDeclaration1ES5iterable.ts(42,17): error TS7031: Binding element 'b' implicitly has an 'any' type.
|
|
destructuringParameterDeclaration1ES5iterable.ts(42,22): error TS7031: Binding element 'c' implicitly has an 'any' type.
|
|
destructuringParameterDeclaration1ES5iterable.ts(43,14): error TS7031: Binding element 'a' implicitly has an 'any' type.
|
|
destructuringParameterDeclaration1ES5iterable.ts(43,17): error TS7031: Binding element 'b' implicitly has an 'any' type.
|
|
destructuringParameterDeclaration1ES5iterable.ts(57,4): error TS2345: Argument of type '[number, number, [[string]], boolean, boolean]' is not assignable to parameter of type '[any, any, [[any]]]'.
|
|
Source has 5 element(s) but target allows only 3.
|
|
destructuringParameterDeclaration1ES5iterable.ts(62,10): error TS2393: Duplicate function implementation.
|
|
destructuringParameterDeclaration1ES5iterable.ts(62,13): error TS7006: Parameter 'x' implicitly has an 'any' type.
|
|
destructuringParameterDeclaration1ES5iterable.ts(63,10): error TS2393: Duplicate function implementation.
|
|
destructuringParameterDeclaration1ES5iterable.ts(66,5): error TS7010: 'd3', which lacks return-type annotation, implicitly has an 'any' return type.
|
|
destructuringParameterDeclaration1ES5iterable.ts(66,9): error TS7031: Binding element 'a' implicitly has an 'any' type.
|
|
destructuringParameterDeclaration1ES5iterable.ts(66,12): error TS7031: Binding element 'b' implicitly has an 'any' type.
|
|
destructuringParameterDeclaration1ES5iterable.ts(66,15): error TS7031: Binding element 'c' implicitly has an 'any' type.
|
|
destructuringParameterDeclaration1ES5iterable.ts(67,5): error TS7010: 'd4', which lacks return-type annotation, implicitly has an 'any' return type.
|
|
destructuringParameterDeclaration1ES5iterable.ts(67,9): error TS7031: Binding element 'x' implicitly has an 'any' type.
|
|
destructuringParameterDeclaration1ES5iterable.ts(67,12): error TS7031: Binding element 'y' implicitly has an 'any' type.
|
|
destructuringParameterDeclaration1ES5iterable.ts(67,15): error TS7031: Binding element 'z' implicitly has an 'any' type.
|
|
destructuringParameterDeclaration1ES5iterable.ts(68,5): error TS7010: 'e0', which lacks return-type annotation, implicitly has an 'any' return type.
|
|
destructuringParameterDeclaration1ES5iterable.ts(68,9): error TS7031: Binding element 'a' implicitly has an 'any' type.
|
|
destructuringParameterDeclaration1ES5iterable.ts(68,12): error TS7031: Binding element 'b' implicitly has an 'any' type.
|
|
destructuringParameterDeclaration1ES5iterable.ts(68,15): error TS7031: Binding element 'c' implicitly has an 'any' type.
|
|
destructuringParameterDeclaration1ES5iterable.ts(75,9): error TS7031: Binding element 'a' implicitly has an 'any' type.
|
|
destructuringParameterDeclaration1ES5iterable.ts(75,12): error TS7031: Binding element 'b' implicitly has an 'any' type.
|
|
destructuringParameterDeclaration1ES5iterable.ts(75,15): error TS7031: Binding element 'c' implicitly has an 'any' type.
|
|
destructuringParameterDeclaration1ES5iterable.ts(79,9): error TS7031: Binding element 'a' implicitly has an 'any' type.
|
|
destructuringParameterDeclaration1ES5iterable.ts(79,12): error TS7031: Binding element 'b' implicitly has an 'any' type.
|
|
destructuringParameterDeclaration1ES5iterable.ts(79,15): error TS7031: Binding element 'c' implicitly has an 'any' type.
|
|
destructuringParameterDeclaration1ES5iterable.ts(80,9): error TS7031: Binding element 'x' implicitly has an 'any' type.
|
|
destructuringParameterDeclaration1ES5iterable.ts(80,12): error TS7031: Binding element 'y' implicitly has an 'any' type.
|
|
destructuringParameterDeclaration1ES5iterable.ts(80,15): error TS7031: Binding element 'z' implicitly has an 'any' type.
|
|
destructuringParameterDeclaration1ES5iterable.ts(81,9): error TS7031: Binding element 'a' implicitly has an 'any' type.
|
|
destructuringParameterDeclaration1ES5iterable.ts(81,12): error TS7031: Binding element 'b' implicitly has an 'any' type.
|
|
destructuringParameterDeclaration1ES5iterable.ts(81,15): error TS7031: Binding element 'c' implicitly has an 'any' type.
|
|
destructuringParameterDeclaration1ES5iterable.ts(92,17): error TS7031: Binding element 'number' implicitly has an 'any' type.
|
|
destructuringParameterDeclaration1ES5iterable.ts(95,18): error TS7031: Binding element 'number' implicitly has an 'any' type.
|
|
destructuringParameterDeclaration1ES5iterable.ts(95,25): error TS7031: Binding element 'string' implicitly has an 'any' type.
|
|
destructuringParameterDeclaration1ES5iterable.ts(95,32): error TS7031: Binding element 'any' implicitly has an 'any' type.
|
|
|
|
|
|
!!! error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration.
|
|
==== destructuringParameterDeclaration1ES5iterable.ts (60 errors) ====
|
|
// A parameter declaration may specify either an identifier or a binding pattern.
|
|
// The identifiers specified in parameter declarations and binding patterns
|
|
// in a parameter list must be unique within that parameter list.
|
|
|
|
// If the declaration includes a type annotation, the parameter is of that type
|
|
function a1([a, b, [[c]]]: [number, number, string[][]]) { }
|
|
function a2(o: { x: number, a: number }) { }
|
|
function a3({j, k, l: {m, n}, q: [a, b, c]}: { j: number, k: string, l: { m: boolean, n: number }, q: (number|string)[] }) { };
|
|
function a4({x, a}: { x: number, a: number }) { }
|
|
|
|
a1([1, 2, [["world"]]]);
|
|
a1([1, 2, [["world"]], 3]);
|
|
~~~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2345: Argument of type '[number, number, string[][], number]' is not assignable to parameter of type '[number, number, string[][]]'.
|
|
!!! error TS2345: Source has 4 element(s) but target allows only 3.
|
|
|
|
// If the declaration includes an initializer expression (which is permitted only
|
|
// when the parameter list occurs in conjunction with a function body),
|
|
// the parameter type is the widened form (section 3.11) of the type of the initializer expression.
|
|
|
|
function b1(z = [undefined, null]) { };
|
|
function b2(z = null, o = { x: 0, y: undefined }) { }
|
|
function b3({z: {x, y: {j}}} = { z: { x: "hi", y: { j: 1 } } }) { }
|
|
|
|
interface F1 {
|
|
b5(z, y, [, a, b], {p, m: { q, r}});
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS7010: 'b5', which lacks return-type annotation, implicitly has an 'any' return type.
|
|
~
|
|
!!! error TS7006: Parameter 'z' implicitly has an 'any' type.
|
|
~
|
|
!!! error TS7006: Parameter 'y' implicitly has an 'any' type.
|
|
~
|
|
!!! error TS7031: Binding element 'a' implicitly has an 'any' type.
|
|
~
|
|
!!! error TS7031: Binding element 'b' implicitly has an 'any' type.
|
|
~
|
|
!!! error TS7031: Binding element 'p' implicitly has an 'any' type.
|
|
~
|
|
!!! error TS7031: Binding element 'q' implicitly has an 'any' type.
|
|
~
|
|
!!! error TS7031: Binding element 'r' implicitly has an 'any' type.
|
|
}
|
|
|
|
function b6([a, z, y] = [undefined, null, undefined]) { }
|
|
function b7([[a], b, [[c, d]]] = [[undefined], undefined, [[undefined, undefined]]]) { }
|
|
|
|
b1([1, 2, 3]); // z is widen to the type any[]
|
|
~
|
|
!!! error TS2322: Type 'number' is not assignable to type 'null | undefined'.
|
|
~
|
|
!!! error TS2322: Type 'number' is not assignable to type 'null | undefined'.
|
|
~
|
|
!!! error TS2322: Type 'number' is not assignable to type 'null | undefined'.
|
|
b2("string", { x: 200, y: "string" });
|
|
~~~~~~~~
|
|
!!! error TS2345: Argument of type '"string"' is not assignable to parameter of type 'null | undefined'.
|
|
b2("string", { x: 200, y: true });
|
|
~~~~~~~~
|
|
!!! error TS2345: Argument of type '"string"' is not assignable to parameter of type 'null | undefined'.
|
|
b6(["string", 1, 2]); // Shouldn't be an error
|
|
~~~~~~~~
|
|
!!! error TS2322: Type 'string' is not assignable to type 'undefined'.
|
|
~
|
|
!!! error TS2322: Type 'number' is not assignable to type 'null'.
|
|
~
|
|
!!! error TS2322: Type 'number' is not assignable to type 'undefined'.
|
|
b7([["string"], 1, [[true, false]]]); // Shouldn't be an error
|
|
~~~~~~~~
|
|
!!! error TS2322: Type 'string' is not assignable to type 'undefined'.
|
|
~
|
|
!!! error TS2322: Type 'number' is not assignable to type 'undefined'.
|
|
~~~~
|
|
!!! error TS2322: Type 'true' is not assignable to type 'undefined'.
|
|
~~~~~
|
|
!!! error TS2322: Type 'false' is not assignable to type 'undefined'.
|
|
|
|
|
|
// If the declaration specifies a binding pattern, the parameter type is the implied type of that binding pattern (section 5.1.3)
|
|
enum Foo { a }
|
|
function c0({z: {x, y: {j}}}) { }
|
|
~
|
|
!!! error TS7031: Binding element 'x' implicitly has an 'any' type.
|
|
~
|
|
!!! error TS7031: Binding element 'j' implicitly has an 'any' type.
|
|
function c1({z} = { z: 10 }) { }
|
|
function c2({z = 10}) { }
|
|
function c3({b}: { b: number|string} = { b: "hello" }) { }
|
|
function c5([a, b, [[c]]]) { }
|
|
~
|
|
!!! error TS7031: Binding element 'a' implicitly has an 'any' type.
|
|
~
|
|
!!! error TS7031: Binding element 'b' implicitly has an 'any' type.
|
|
~
|
|
!!! error TS7031: Binding element 'c' implicitly has an 'any' type.
|
|
function c6([a, b, [[c=1]]]) { }
|
|
~
|
|
!!! error TS7031: Binding element 'a' implicitly has an 'any' type.
|
|
~
|
|
!!! error TS7031: Binding element 'b' implicitly has an 'any' type.
|
|
|
|
c0({z : { x: 1, y: { j: "world" } }}); // Implied type is { z: {x: any, y: {j: any}} }
|
|
c0({z : { x: "string", y: { j: true } }}); // Implied type is { z: {x: any, y: {j: any}} }
|
|
|
|
c1(); // Implied type is {z:number}?
|
|
c1({ z: 1 }) // Implied type is {z:number}?
|
|
|
|
c2({}); // Implied type is {z?: number}
|
|
c2({z:1}); // Implied type is {z?: number}
|
|
|
|
c3({ b: 1 }); // Implied type is { b: number|string }.
|
|
|
|
c5([1, 2, [["string"]]]); // Implied type is is [any, any, [[any]]]
|
|
c5([1, 2, [["string"]], false, true]); // Implied type is is [any, any, [[any]]]
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2345: Argument of type '[number, number, [[string]], boolean, boolean]' is not assignable to parameter of type '[any, any, [[any]]]'.
|
|
!!! error TS2345: Source has 5 element(s) but target allows only 3.
|
|
|
|
// A parameter can be marked optional by following its name or binding pattern with a question mark (?)
|
|
// or by including an initializer.
|
|
|
|
function d0(x?) { }
|
|
~~
|
|
!!! error TS2393: Duplicate function implementation.
|
|
~~
|
|
!!! error TS7006: Parameter 'x' implicitly has an 'any' type.
|
|
function d0(x = 10) { }
|
|
~~
|
|
!!! error TS2393: Duplicate function implementation.
|
|
|
|
interface F2 {
|
|
d3([a, b, c]?);
|
|
~~~~~~~~~~~~~~~
|
|
!!! error TS7010: 'd3', which lacks return-type annotation, implicitly has an 'any' return type.
|
|
~
|
|
!!! error TS7031: Binding element 'a' implicitly has an 'any' type.
|
|
~
|
|
!!! error TS7031: Binding element 'b' implicitly has an 'any' type.
|
|
~
|
|
!!! error TS7031: Binding element 'c' implicitly has an 'any' type.
|
|
d4({x, y, z}?);
|
|
~~~~~~~~~~~~~~~
|
|
!!! error TS7010: 'd4', which lacks return-type annotation, implicitly has an 'any' return type.
|
|
~
|
|
!!! error TS7031: Binding element 'x' implicitly has an 'any' type.
|
|
~
|
|
!!! error TS7031: Binding element 'y' implicitly has an 'any' type.
|
|
~
|
|
!!! error TS7031: Binding element 'z' implicitly has an 'any' type.
|
|
e0([a, b, c]);
|
|
~~~~~~~~~~~~~~
|
|
!!! error TS7010: 'e0', which lacks return-type annotation, implicitly has an 'any' return type.
|
|
~
|
|
!!! error TS7031: Binding element 'a' implicitly has an 'any' type.
|
|
~
|
|
!!! error TS7031: Binding element 'b' implicitly has an 'any' type.
|
|
~
|
|
!!! error TS7031: Binding element 'c' implicitly has an 'any' type.
|
|
}
|
|
|
|
class C2 implements F2 {
|
|
constructor() { }
|
|
d3() { }
|
|
d4() { }
|
|
e0([a, b, c]) { }
|
|
~
|
|
!!! error TS7031: Binding element 'a' implicitly has an 'any' type.
|
|
~
|
|
!!! error TS7031: Binding element 'b' implicitly has an 'any' type.
|
|
~
|
|
!!! error TS7031: Binding element 'c' implicitly has an 'any' type.
|
|
}
|
|
|
|
class C3 implements F2 {
|
|
d3([a, b, c]) { }
|
|
~
|
|
!!! error TS7031: Binding element 'a' implicitly has an 'any' type.
|
|
~
|
|
!!! error TS7031: Binding element 'b' implicitly has an 'any' type.
|
|
~
|
|
!!! error TS7031: Binding element 'c' implicitly has an 'any' type.
|
|
d4({x, y, z}) { }
|
|
~
|
|
!!! error TS7031: Binding element 'x' implicitly has an 'any' type.
|
|
~
|
|
!!! error TS7031: Binding element 'y' implicitly has an 'any' type.
|
|
~
|
|
!!! error TS7031: Binding element 'z' implicitly has an 'any' type.
|
|
e0([a, b, c]) { }
|
|
~
|
|
!!! error TS7031: Binding element 'a' implicitly has an 'any' type.
|
|
~
|
|
!!! error TS7031: Binding element 'b' implicitly has an 'any' type.
|
|
~
|
|
!!! error TS7031: Binding element 'c' implicitly has an 'any' type.
|
|
}
|
|
|
|
|
|
function d5({x, y} = { x: 1, y: 2 }) { }
|
|
d5(); // Parameter is optional as its declaration included an initializer
|
|
|
|
// Destructuring parameter declarations do not permit type annotations on the individual binding patterns,
|
|
// as such annotations would conflict with the already established meaning of colons in object literals.
|
|
// Type annotations must instead be written on the top- level parameter declaration
|
|
|
|
function e1({x: number}) { } // x has type any NOT number
|
|
~~~~~~
|
|
!!! error TS7031: Binding element 'number' implicitly has an 'any' type.
|
|
function e2({x}: { x: number }) { } // x is type number
|
|
function e3({x}: { x?: number }) { } // x is an optional with type number
|
|
function e4({x: [number,string,any] }) { } // x has type [any, any, any]
|
|
~~~~~~
|
|
!!! error TS7031: Binding element 'number' implicitly has an 'any' type.
|
|
~~~~~~
|
|
!!! error TS7031: Binding element 'string' implicitly has an 'any' type.
|
|
~~~
|
|
!!! error TS7031: Binding element 'any' implicitly has an 'any' type.
|
|
function e5({x: [a, b, c]}: { x: [number, number, number] }) { } // x has type [any, any, any]
|
|
|