Merge pull request #25397 from a-tarasyuk/bug/25356-instance-property-is-not-a-block-scoped-variable

25356 - Instance property is not a block scoped variable
This commit is contained in:
Mohamed Hegazy
2018-07-03 14:11:28 -07:00
committed by GitHub
13 changed files with 32 additions and 27 deletions

View File

@@ -17483,7 +17483,7 @@ namespace ts {
if (isInPropertyInitializer(node) &&
!isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)
&& !isPropertyDeclaredInAncestorClass(prop)) {
diagnosticMessage = error(right, Diagnostics.Block_scoped_variable_0_used_before_its_declaration, declarationName);
diagnosticMessage = error(right, Diagnostics.Property_0_is_used_before_its_initialization, declarationName);
}
else if (valueDeclaration.kind === SyntaxKind.ClassDeclaration &&
node.parent.kind !== SyntaxKind.TypeReference &&

View File

@@ -2401,6 +2401,10 @@
"category": "Error",
"code": 2728
},
"Property '{0}' is used before its initialization.": {
"category": "Error",
"code": 2729
},
"Import declaration '{0}' is using private name '{1}'.": {
"category": "Error",