Skip to content

Commit 6ff0ba6

Browse files
committed
Add new error message - Property {0} is used before its initialization.
1 parent e13fd0c commit 6ff0ba6

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17478,7 +17478,7 @@ namespace ts {
1747817478
if (isInPropertyInitializer(node) &&
1747917479
!isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)
1748017480
&& !isPropertyDeclaredInAncestorClass(prop)) {
17481-
diagnosticMessage = error(right, Diagnostics.Block_scoped_variable_0_used_before_its_declaration, declarationName);
17481+
diagnosticMessage = error(right, Diagnostics.Property_0_is_used_before_its_initialization, declarationName);
1748217482
}
1748317483
else if (valueDeclaration.kind === SyntaxKind.ClassDeclaration &&
1748417484
node.parent.kind !== SyntaxKind.TypeReference &&

src/compiler/diagnosticMessages.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2401,6 +2401,10 @@
24012401
"category": "Error",
24022402
"code": 2728
24032403
},
2404+
"Property '{0}' is used before its initialization.": {
2405+
"category": "Error",
2406+
"code": 2729
2407+
},
24042408

24052409
"Import declaration '{0}' is using private name '{1}'.": {
24062410
"category": "Error",

0 commit comments

Comments
 (0)