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

37 lines
1.8 KiB
Plaintext
Raw Normal View History

tests/cases/compiler/defaultArgsInOverloads.ts(2,14): error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
tests/cases/compiler/defaultArgsInOverloads.ts(7,6): error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
tests/cases/compiler/defaultArgsInOverloads.ts(10,13): error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
tests/cases/compiler/defaultArgsInOverloads.ts(16,9): error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
tests/cases/compiler/defaultArgsInOverloads.ts(19,9): error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
2014-07-13 01:04:16 +02:00
==== tests/cases/compiler/defaultArgsInOverloads.ts (5 errors) ====
function fun(a: string);
function fun(a = 3);
~~~~~
!!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
2014-07-13 01:04:16 +02:00
function fun(a = null) { }
class C {
fun(a: string);
fun(a = 3);
~~~~~
!!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
2014-07-13 01:04:16 +02:00
fun(a = null) { }
static fun(a: string);
static fun(a = 3);
~~~~~
!!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
2014-07-13 01:04:16 +02:00
static fun(a = null) { }
}
interface I {
fun(a: string);
fun(a = 3);
~~~~~
!!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
2014-07-13 01:04:16 +02:00
}
var f: (a = 3) => number;
~~~~~
!!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation.