20 lines
No EOL
787 B
Text
20 lines
No EOL
787 B
Text
==== tests/cases/compiler/optionalArgsWithDefaultValues.ts (5 errors) ====
|
|
function foo(x: number, y?:boolean=false, z?=0) {}
|
|
~
|
|
!!! Parameter cannot have question mark and initializer.
|
|
|
|
class CCC {
|
|
public foo(x: number, y?:boolean=false, z?=0) {}
|
|
~
|
|
!!! Parameter cannot have question mark and initializer.
|
|
static foo2(x: number, y?:boolean=false, z?=0) {}
|
|
~
|
|
!!! Parameter cannot have question mark and initializer.
|
|
}
|
|
|
|
var a = (x?=0) => { return 1; };
|
|
~
|
|
!!! Parameter cannot have question mark and initializer.
|
|
var b = (x, y?:number = 2) => { x; };
|
|
~
|
|
!!! Parameter cannot have question mark and initializer. |