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

18 lines
597 B
Plaintext
Raw Normal View History

2014-07-13 01:04:16 +02:00
==== tests/cases/compiler/constructorParametersThatShadowExternalNamesInVariableDeclarations.ts (2 errors) ====
var x = 1;
class A {
private a = x;
~
!!! Initializer of instance member variable 'a' cannot reference identifier 'x' declared in the constructor.
constructor(x: number) {
}
}
class B {
private a = x;
~
!!! Initializer of instance member variable 'a' cannot reference identifier 'x' declared in the constructor.
constructor() {
var x = "";
}
}