Skip to content

Commit

Permalink
Update baselines for private name errors
Browse files Browse the repository at this point in the history
Signed-off-by: Joey Watts <jwatts43@bloomberg.net>
  • Loading branch information
Joey Watts committed Jun 27, 2019
1 parent 5bea122 commit 71c384a
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tests/cases/conformance/classes/members/privateNames/privateNameConstructorReserved.ts(4,5): error TS1811: '#constructor' is a reserved word.
tests/cases/conformance/classes/members/privateNames/privateNameConstructorReserved.ts(4,5): error TS18012: '#constructor' is a reserved word.


==== tests/cases/conformance/classes/members/privateNames/privateNameConstructorReserved.ts (1 errors) ====
Expand All @@ -7,6 +7,6 @@ tests/cases/conformance/classes/members/privateNames/privateNameConstructorReser
class A {
#constructor() {} // Error: `#constructor` is a reserved word.
~~~~~~~~~~~~
!!! error TS1811: '#constructor' is a reserved word.
!!! error TS18012: '#constructor' is a reserved word.
}

Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
tests/cases/conformance/classes/members/privateNames/privateNameInObjectLiteral-1.ts(2,5): error TS18015: Private names are not allowed outside class bodies.
tests/cases/conformance/classes/members/privateNames/privateNameInObjectLiteral-1.ts(2,5): error TS18016: Private names are not allowed outside class bodies.


==== tests/cases/conformance/classes/members/privateNames/privateNameInObjectLiteral-1.ts (1 errors) ====
const obj = {
#foo: 1
~~~~
!!! error TS18015: Private names are not allowed outside class bodies.
!!! error TS18016: Private names are not allowed outside class bodies.
};

Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
tests/cases/conformance/classes/members/privateNames/privateNameInObjectLiteral-2.ts(2,5): error TS18015: Private names are not allowed outside class bodies.
tests/cases/conformance/classes/members/privateNames/privateNameInObjectLiteral-2.ts(2,5): error TS18016: Private names are not allowed outside class bodies.


==== tests/cases/conformance/classes/members/privateNames/privateNameInObjectLiteral-2.ts (1 errors) ====
const obj = {
#foo() {
~~~~
!!! error TS18015: Private names are not allowed outside class bodies.
!!! error TS18016: Private names are not allowed outside class bodies.

}
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tests/cases/conformance/classes/members/privateNames/privateNameNotAccessibleOutsideDefiningClass.ts(7,9): error TS2339: Property '#foo' does not exist on type 'A'.
tests/cases/conformance/classes/members/privateNames/privateNameNotAccessibleOutsideDefiningClass.ts(7,9): error TS18012: Property '#foo' is not accessible outside class 'A' because it has a private name.
tests/cases/conformance/classes/members/privateNames/privateNameNotAccessibleOutsideDefiningClass.ts(7,9): error TS18013: Property '#foo' is not accessible outside class 'A' because it has a private name.


==== tests/cases/conformance/classes/members/privateNames/privateNameNotAccessibleOutsideDefiningClass.ts (2 errors) ====
Expand All @@ -13,5 +13,5 @@ tests/cases/conformance/classes/members/privateNames/privateNameNotAccessibleOut
~~~~
!!! error TS2339: Property '#foo' does not exist on type 'A'.
~~~~
!!! error TS18012: Property '#foo' is not accessible outside class 'A' because it has a private name.
!!! error TS18013: Property '#foo' is not accessible outside class 'A' because it has a private name.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tests/cases/conformance/classes/members/privateNames/privateNamesAndGenericClasses-2.ts(24,3): error TS2339: Property '#foo' does not exist on type 'C<number>'.
tests/cases/conformance/classes/members/privateNames/privateNamesAndGenericClasses-2.ts(24,3): error TS18012: Property '#foo' is not accessible outside class 'C<T>' because it has a private name.
tests/cases/conformance/classes/members/privateNames/privateNamesAndGenericClasses-2.ts(24,3): error TS18013: Property '#foo' is not accessible outside class 'C<T>' because it has a private name.
tests/cases/conformance/classes/members/privateNames/privateNamesAndGenericClasses-2.ts(25,1): error TS2322: Type 'C<string>' is not assignable to type 'C<number>'.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/classes/members/privateNames/privateNamesAndGenericClasses-2.ts(26,1): error TS2322: Type 'C<number>' is not assignable to type 'C<string>'.
Expand Down Expand Up @@ -34,7 +34,7 @@ tests/cases/conformance/classes/members/privateNames/privateNamesAndGenericClass
~~~~
!!! error TS2339: Property '#foo' does not exist on type 'C<number>'.
~~~~
!!! error TS18012: Property '#foo' is not accessible outside class 'C<T>' because it has a private name.
!!! error TS18013: Property '#foo' is not accessible outside class 'C<T>' because it has a private name.
a = b; // Error
~
!!! error TS2322: Type 'C<string>' is not assignable to type 'C<number>'.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tests/cases/conformance/classes/members/privateNames/privateNamesInGenericClasses.ts(10,3): error TS2339: Property '#foo' does not exist on type 'C<number>'.
tests/cases/conformance/classes/members/privateNames/privateNamesInGenericClasses.ts(10,3): error TS18012: Property '#foo' is not accessible outside class 'C<T>' because it has a private name.
tests/cases/conformance/classes/members/privateNames/privateNamesInGenericClasses.ts(10,3): error TS18013: Property '#foo' is not accessible outside class 'C<T>' because it has a private name.
tests/cases/conformance/classes/members/privateNames/privateNamesInGenericClasses.ts(11,1): error TS2322: Type 'C<string>' is not assignable to type 'C<number>'.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/classes/members/privateNames/privateNamesInGenericClasses.ts(12,1): error TS2322: Type 'C<number>' is not assignable to type 'C<string>'.
Expand All @@ -20,7 +20,7 @@ tests/cases/conformance/classes/members/privateNames/privateNamesInGenericClasse
~~~~
!!! error TS2339: Property '#foo' does not exist on type 'C<number>'.
~~~~
!!! error TS18012: Property '#foo' is not accessible outside class 'C<T>' because it has a private name.
!!! error TS18013: Property '#foo' is not accessible outside class 'C<T>' because it has a private name.
a = b; // Error
~
!!! error TS2322: Type 'C<string>' is not assignable to type 'C<number>'.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tests/cases/conformance/classes/members/privateNames/privateNamesInNestedClasses.ts(13,18): error TS2339: Property '#foo' does not exist on type 'A'.
tests/cases/conformance/classes/members/privateNames/privateNamesInNestedClasses.ts(13,18): error TS18013: This usage of '#foo' refers to the private member declared in its enclosing class. While type 'B' has a private member with the same spelling, its declaration and accessibility are distinct.
tests/cases/conformance/classes/members/privateNames/privateNamesInNestedClasses.ts(13,18): error TS18014: This usage of '#foo' refers to the private member declared in its enclosing class. While type 'B' has a private member with the same spelling, its declaration and accessibility are distinct.


==== tests/cases/conformance/classes/members/privateNames/privateNamesInNestedClasses.ts (2 errors) ====
Expand All @@ -19,7 +19,7 @@ tests/cases/conformance/classes/members/privateNames/privateNamesInNestedClasses
~~~~
!!! error TS2339: Property '#foo' does not exist on type 'A'.
~~~~
!!! error TS18013: This usage of '#foo' refers to the private member declared in its enclosing class. While type 'B' has a private member with the same spelling, its declaration and accessibility are distinct.
!!! error TS18014: This usage of '#foo' refers to the private member declared in its enclosing class. While type 'B' has a private member with the same spelling, its declaration and accessibility are distinct.
}
quux (b: B) {
b.#foo; // OK
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
tests/cases/conformance/classes/members/privateNames/privateNamesNoAccessibilityModifiers.ts(4,12): error TS18009: Accessibility modifiers cannot be used with private names.
tests/cases/conformance/classes/members/privateNames/privateNamesNoAccessibilityModifiers.ts(5,13): error TS18009: Accessibility modifiers cannot be used with private names.
tests/cases/conformance/classes/members/privateNames/privateNamesNoAccessibilityModifiers.ts(6,15): error TS18009: Accessibility modifiers cannot be used with private names.
tests/cases/conformance/classes/members/privateNames/privateNamesNoAccessibilityModifiers.ts(4,12): error TS18010: Accessibility modifiers cannot be used with private names.
tests/cases/conformance/classes/members/privateNames/privateNamesNoAccessibilityModifiers.ts(5,13): error TS18010: Accessibility modifiers cannot be used with private names.
tests/cases/conformance/classes/members/privateNames/privateNamesNoAccessibilityModifiers.ts(6,15): error TS18010: Accessibility modifiers cannot be used with private names.


==== tests/cases/conformance/classes/members/privateNames/privateNamesNoAccessibilityModifiers.ts (3 errors) ====
Expand All @@ -9,13 +9,13 @@ tests/cases/conformance/classes/members/privateNames/privateNamesNoAccessibility
class A {
public #foo = 3; // Error
~~~~
!!! error TS18009: Accessibility modifiers cannot be used with private names.
!!! error TS18010: Accessibility modifiers cannot be used with private names.
private #bar = 3; // Error
~~~~
!!! error TS18009: Accessibility modifiers cannot be used with private names.
!!! error TS18010: Accessibility modifiers cannot be used with private names.
protected #baz = 3; // Error
~~~~
!!! error TS18009: Accessibility modifiers cannot be used with private names.
!!! error TS18010: Accessibility modifiers cannot be used with private names.
readonly #qux = 3; // OK
}

4 changes: 2 additions & 2 deletions tests/baselines/reference/privateNamesNoDelete.errors.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tests/cases/conformance/classes/members/privateNames/privateNamesNoDelete.ts(6,16): error TS18010: The operand of a delete operator cannot be a private name.
tests/cases/conformance/classes/members/privateNames/privateNamesNoDelete.ts(6,16): error TS18011: The operand of a delete operator cannot be a private name.


==== tests/cases/conformance/classes/members/privateNames/privateNamesNoDelete.ts (1 errors) ====
Expand All @@ -9,7 +9,7 @@ tests/cases/conformance/classes/members/privateNames/privateNamesNoDelete.ts(6,1
constructor() {
delete this.#v; // Error: The operand of a delete operator cannot be a private name.
~~~~~~~
!!! error TS18010: The operand of a delete operator cannot be a private name.
!!! error TS18011: The operand of a delete operator cannot be a private name.
}
}

0 comments on commit 71c384a

Please sign in to comment.