Skip to content

Commit 4b12353

Browse files
committed
Test case for the privacy check of variables and properties during declaration emit
1 parent 5810bfe commit 4b12353

File tree

5 files changed

+1616
-4
lines changed

5 files changed

+1616
-4
lines changed

src/compiler/emitter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2291,12 +2291,12 @@ module ts {
22912291
Diagnostics.Exported_variable_0_has_or_is_using_private_name_1;
22922292
}
22932293
else {
2294-
if (node.parent.flags & NodeFlags.Static) {
2294+
if (node.flags & NodeFlags.Static) {
22952295
diagnosticMessage = symbolAccesibilityResult.errorModuleName ?
22962296
Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 :
22972297
Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1;
22982298
}
2299-
else if (node.parent.parent.kind === SyntaxKind.ClassDeclaration) {
2299+
else if (node.parent.kind === SyntaxKind.ClassDeclaration) {
23002300
diagnosticMessage = symbolAccesibilityResult.errorModuleName ?
23012301
Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 :
23022302
Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1;

tests/baselines/reference/declInput-2.errors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
public m2: string;
1111
public m22: C; // don't generate
1212
~~~~~~~~~~~~~~
13-
!!! Property 'm22' of exported interface has or is using private name 'C'.
13+
!!! Public property 'm22' of exported class has or is using private name 'C'.
1414
public m23: E;
1515
public m24: I1;
1616
public m25: I2; // don't generate
1717
~~~~~~~~~~~~~~~
18-
!!! Property 'm25' of exported interface has or is using private name 'I2'.
18+
!!! Public property 'm25' of exported class has or is using private name 'I2'.
1919
public m232(): E { return null;}
2020
public m242(): I1 { return null; }
2121
public m252(): I2 { return null; } // don't generate

0 commit comments

Comments
 (0)