mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-20 22:51:17 -05:00
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:
@@ -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 &&
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user