23 lines
1.2 KiB
Plaintext
23 lines
1.2 KiB
Plaintext
tests/cases/conformance/functions/functionOverloadErrorsSyntax.ts(2,27): error TS1016: A required parameter cannot follow an optional parameter.
|
|
tests/cases/conformance/functions/functionOverloadErrorsSyntax.ts(5,38): error TS1016: A required parameter cannot follow an optional parameter.
|
|
tests/cases/conformance/functions/functionOverloadErrorsSyntax.ts(9,25): error TS1014: A rest parameter must be last in a parameter list.
|
|
|
|
|
|
==== tests/cases/conformance/functions/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() { }
|
|
|