mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
23 lines
1.1 KiB
Plaintext
23 lines
1.1 KiB
Plaintext
functionOverloadErrorsSyntax.ts(2,27): error TS1016: A required parameter cannot follow an optional parameter.
|
|
functionOverloadErrorsSyntax.ts(5,38): error TS1016: A required parameter cannot follow an optional parameter.
|
|
functionOverloadErrorsSyntax.ts(9,25): error TS1014: A rest parameter must be last in a parameter list.
|
|
|
|
|
|
==== functionOverloadErrorsSyntax.ts (3 errors) ====
|
|
//Function overload signature with optional parameter followed by non-optional parameter
|
|
function fn4a(x?: number, y: string);
|
|
~
|
|
!!! error TS1016: A required parameter cannot follow an optional parameter.
|
|
function fn4a() { }
|
|
|
|
function fn4b(n: string, x?: number, y: string);
|
|
~
|
|
!!! error TS1016: A required parameter cannot follow an optional parameter.
|
|
function fn4b() { }
|
|
|
|
//Function overload signature with rest param followed by non-optional parameter
|
|
function fn5(x: string, ...y: any[], z: string);
|
|
~~~
|
|
!!! error TS1014: A rest parameter must be last in a parameter list.
|
|
function fn5() { }
|
|
|