TypeScript/tests/baselines/reference/selfReferencesInFunctionParameters.errors.txt
2014-07-12 17:30:19 -07:00

22 lines
707 B
Plaintext

==== 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.
}
}