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

22 lines
707 B
Plaintext
Raw Normal View History

2014-07-13 01:04:16 +02:00
==== tests/cases/compiler/selfReferencesInFunctionParameters.ts (4 errors) ====
function foo(x: number = x) {
~
!!! Parameter 'x' cannot be referenced in its initializer.
}
function bar(x0 = "", x: number = x) {
~
!!! Parameter 'x' cannot be referenced in its initializer.
}
class C {
constructor(x = 1, y = y) {
~
!!! Parameter 'y' cannot be referenced in its initializer.
}
bar(a = "", b: string = b.toString()) {
~
!!! Parameter 'b' cannot be referenced in its initializer.
}
}