TypeScript/tests/baselines/reference/optionalArgsWithDefaultValues.errors.txt

27 lines
1.5 KiB
Plaintext
Raw Normal View History

tests/cases/compiler/optionalArgsWithDefaultValues.ts(1,25): error TS1015: Parameter cannot have question mark and initializer.
tests/cases/compiler/optionalArgsWithDefaultValues.ts(4,27): error TS1015: Parameter cannot have question mark and initializer.
tests/cases/compiler/optionalArgsWithDefaultValues.ts(5,28): error TS1015: Parameter cannot have question mark and initializer.
tests/cases/compiler/optionalArgsWithDefaultValues.ts(8,10): error TS1015: Parameter cannot have question mark and initializer.
tests/cases/compiler/optionalArgsWithDefaultValues.ts(9,13): error TS1015: Parameter cannot have question mark and initializer.
2014-07-13 01:04:16 +02:00
==== tests/cases/compiler/optionalArgsWithDefaultValues.ts (5 errors) ====
function foo(x: number, y?:boolean=false, z?=0) {}
~
!!! error TS1015: Parameter cannot have question mark and initializer.
2014-07-13 01:04:16 +02:00
class CCC {
public foo(x: number, y?:boolean=false, z?=0) {}
~
!!! error TS1015: Parameter cannot have question mark and initializer.
2014-07-13 01:04:16 +02:00
static foo2(x: number, y?:boolean=false, z?=0) {}
~
!!! error TS1015: Parameter cannot have question mark and initializer.
2014-07-13 01:04:16 +02:00
}
var a = (x?=0) => { return 1; };
~
!!! error TS1015: Parameter cannot have question mark and initializer.
2014-07-13 01:04:16 +02:00
var b = (x, y?:number = 2) => { x; };
~
!!! error TS1015: Parameter cannot have question mark and initializer.