1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
|
error TS2318: Cannot find global type 'AsyncIterableIterator'.
tests/cases/conformance/classes/members/privateNames/privateNamesIncompatibleModifiers.ts(2,5): error TS18010: An accessibility modifier cannot be used with a private identifier.
tests/cases/conformance/classes/members/privateNames/privateNamesIncompatibleModifiers.ts(3,5): error TS18010: An accessibility modifier cannot be used with a private identifier.
tests/cases/conformance/classes/members/privateNames/privateNamesIncompatibleModifiers.ts(4,5): error TS18010: An accessibility modifier cannot be used with a private identifier.
tests/cases/conformance/classes/members/privateNames/privateNamesIncompatibleModifiers.ts(6,5): error TS18019: 'declare' modifier cannot be used with a private identifier.
tests/cases/conformance/classes/members/privateNames/privateNamesIncompatibleModifiers.ts(8,5): error TS18010: An accessibility modifier cannot be used with a private identifier.
tests/cases/conformance/classes/members/privateNames/privateNamesIncompatibleModifiers.ts(9,5): error TS18010: An accessibility modifier cannot be used with a private identifier.
tests/cases/conformance/classes/members/privateNames/privateNamesIncompatibleModifiers.ts(10,5): error TS18010: An accessibility modifier cannot be used with a private identifier.
tests/cases/conformance/classes/members/privateNames/privateNamesIncompatibleModifiers.ts(11,5): error TS1024: 'readonly' modifier can only appear on a property declaration or index signature.
tests/cases/conformance/classes/members/privateNames/privateNamesIncompatibleModifiers.ts(12,5): error TS1031: 'declare' modifier cannot appear on class elements of this kind.
tests/cases/conformance/classes/members/privateNames/privateNamesIncompatibleModifiers.ts(17,5): error TS18010: An accessibility modifier cannot be used with a private identifier.
tests/cases/conformance/classes/members/privateNames/privateNamesIncompatibleModifiers.ts(18,5): error TS18010: An accessibility modifier cannot be used with a private identifier.
tests/cases/conformance/classes/members/privateNames/privateNamesIncompatibleModifiers.ts(19,5): error TS18010: An accessibility modifier cannot be used with a private identifier.
tests/cases/conformance/classes/members/privateNames/privateNamesIncompatibleModifiers.ts(20,5): error TS18010: An accessibility modifier cannot be used with a private identifier.
tests/cases/conformance/classes/members/privateNames/privateNamesIncompatibleModifiers.ts(21,5): error TS18010: An accessibility modifier cannot be used with a private identifier.
tests/cases/conformance/classes/members/privateNames/privateNamesIncompatibleModifiers.ts(22,5): error TS18010: An accessibility modifier cannot be used with a private identifier.
tests/cases/conformance/classes/members/privateNames/privateNamesIncompatibleModifiers.ts(23,5): error TS1024: 'readonly' modifier can only appear on a property declaration or index signature.
tests/cases/conformance/classes/members/privateNames/privateNamesIncompatibleModifiers.ts(24,5): error TS1024: 'readonly' modifier can only appear on a property declaration or index signature.
tests/cases/conformance/classes/members/privateNames/privateNamesIncompatibleModifiers.ts(25,5): error TS1031: 'declare' modifier cannot appear on class elements of this kind.
tests/cases/conformance/classes/members/privateNames/privateNamesIncompatibleModifiers.ts(26,5): error TS1031: 'declare' modifier cannot appear on class elements of this kind.
tests/cases/conformance/classes/members/privateNames/privateNamesIncompatibleModifiers.ts(27,5): error TS1042: 'async' modifier cannot be used here.
tests/cases/conformance/classes/members/privateNames/privateNamesIncompatibleModifiers.ts(28,5): error TS1042: 'async' modifier cannot be used here.
tests/cases/conformance/classes/members/privateNames/privateNamesIncompatibleModifiers.ts(32,5): error TS18019: 'abstract' modifier cannot be used with a private identifier.
tests/cases/conformance/classes/members/privateNames/privateNamesIncompatibleModifiers.ts(32,14): error TS1267: Property '#quux' cannot have an initializer because it is marked abstract.
!!! error TS2318: Cannot find global type 'AsyncIterableIterator'.
==== tests/cases/conformance/classes/members/privateNames/privateNamesIncompatibleModifiers.ts (23 errors) ====
class A {
public #foo = 3; // Error
~~~~~~
!!! error TS18010: An accessibility modifier cannot be used with a private identifier.
private #bar = 3; // Error
~~~~~~~
!!! error TS18010: An accessibility modifier cannot be used with a private identifier.
protected #baz = 3; // Error
~~~~~~~~~
!!! error TS18010: An accessibility modifier cannot be used with a private identifier.
readonly #qux = 3; // OK
declare #what: number; // Error
~~~~~~~
!!! error TS18019: 'declare' modifier cannot be used with a private identifier.
public #fooMethod() { return 3; } // Error
~~~~~~
!!! error TS18010: An accessibility modifier cannot be used with a private identifier.
private #barMethod() { return 3; } // Error
~~~~~~~
!!! error TS18010: An accessibility modifier cannot be used with a private identifier.
protected #bazMethod() { return 3; } // Error
~~~~~~~~~
!!! error TS18010: An accessibility modifier cannot be used with a private identifier.
readonly #quxMethod() { return 3; } // Error
~~~~~~~~
!!! error TS1024: 'readonly' modifier can only appear on a property declaration or index signature.
declare #whatMethod() // Error
~~~~~~~
!!! error TS1031: 'declare' modifier cannot appear on class elements of this kind.
async #asyncMethod() { return 1; } //OK
*#genMethod() { return 1; } //OK
async *#asyncGenMethod() { return 1; } //OK
public get #fooProp() { return 3; } // Error
~~~~~~
!!! error TS18010: An accessibility modifier cannot be used with a private identifier.
public set #fooProp(value: number) { } // Error
~~~~~~
!!! error TS18010: An accessibility modifier cannot be used with a private identifier.
private get #barProp() { return 3; } // Error
~~~~~~~
!!! error TS18010: An accessibility modifier cannot be used with a private identifier.
private set #barProp(value: number) { } // Error
~~~~~~~
!!! error TS18010: An accessibility modifier cannot be used with a private identifier.
protected get #bazProp() { return 3; } // Error
~~~~~~~~~
!!! error TS18010: An accessibility modifier cannot be used with a private identifier.
protected set #bazProp(value: number) { } // Error
~~~~~~~~~
!!! error TS18010: An accessibility modifier cannot be used with a private identifier.
readonly get #quxProp() { return 3; } // Error
~~~~~~~~
!!! error TS1024: 'readonly' modifier can only appear on a property declaration or index signature.
readonly set #quxProp(value: number) { } // Error
~~~~~~~~
!!! error TS1024: 'readonly' modifier can only appear on a property declaration or index signature.
declare get #whatProp() // Error
~~~~~~~
!!! error TS1031: 'declare' modifier cannot appear on class elements of this kind.
declare set #whatProp(value: number) // Error
~~~~~~~
!!! error TS1031: 'declare' modifier cannot appear on class elements of this kind.
async get #asyncProp() { return 1; } // Error
~~~~~
!!! error TS1042: 'async' modifier cannot be used here.
async set #asyncProp(value: number) { } // Error
~~~~~
!!! error TS1042: 'async' modifier cannot be used here.
}
abstract class B {
abstract #quux = 3; // Error
~~~~~~~~
!!! error TS18019: 'abstract' modifier cannot be used with a private identifier.
~~~~~
!!! error TS1267: Property '#quux' cannot have an initializer because it is marked abstract.
}
|