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 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161
|
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(3,14): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(3,24): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(4,22): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(4,32): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(5,20): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(5,30): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(6,14): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(7,14): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(9,15): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(9,34): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(10,23): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(10,42): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(11,20): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(11,39): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(12,11): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(12,30): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(13,14): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(13,28): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(16,9): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(16,19): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(17,10): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(17,28): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(18,13): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(18,26): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(22,6): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(22,17): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(23,6): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(23,25): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(24,9): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(24,20): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(25,9): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(26,19): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(30,9): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(30,19): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(31,10): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(31,29): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(35,9): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(36,32): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(37,12): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(37,25): error TS2369: A parameter property is only allowed in a constructor implementation.
==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts (40 errors) ====
// Call signature parameters do not allow accessibility modifiers
function foo(public x, private y) { }
~~~~~~~~
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
~~~~~~~~~
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
var f = function foo(public x, private y) { }
~~~~~~~~
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
~~~~~~~~~
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
var f2 = function (public x, private y) { }
~~~~~~~~
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
~~~~~~~~~
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
var f3 = (x, private y) => { }
~~~~~~~~~
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
var f4 = <T>(public x: T, y: T) => { }
~~~~~~~~~~~
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
function foo2(private x: string, public y: number) { }
~~~~~~~~~~~~~~~~~
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
~~~~~~~~~~~~~~~~
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
var f5 = function foo(private x: string, public y: number) { }
~~~~~~~~~~~~~~~~~
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
~~~~~~~~~~~~~~~~
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
var f6 = function (private x: string, public y: number) { }
~~~~~~~~~~~~~~~~~
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
~~~~~~~~~~~~~~~~
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
var f7 = (private x: string, public y: number) => { }
~~~~~~~~~~~~~~~~~
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
~~~~~~~~~~~~~~~~
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
var f8 = <T>(private x: T, public y: T) => { }
~~~~~~~~~~~~
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
~~~~~~~~~~~
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
class C {
foo(public x, private y) { }
~~~~~~~~
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
~~~~~~~~~
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
foo2(public x: number, private y: string) { }
~~~~~~~~~~~~~~~~
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
~~~~~~~~~~~~~~~~~
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
foo3<T>(public x: T, private y: T) { }
~~~~~~~~~~~
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
~~~~~~~~~~~~
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
}
interface I {
(private x, public y);
~~~~~~~~~
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
~~~~~~~~
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
(private x: string, public y: number);
~~~~~~~~~~~~~~~~~
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
~~~~~~~~~~~~~~~~
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
foo(private x, public y);
~~~~~~~~~
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
~~~~~~~~
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
foo(public x: number, y: string);
~~~~~~~~~~~~~~~~
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
foo3<T>(x: T, private y: T);
~~~~~~~~~~~~
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
}
var a: {
foo(public x, private y);
~~~~~~~~
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
~~~~~~~~~
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
foo2(private x: number, public y: string);
~~~~~~~~~~~~~~~~~
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
~~~~~~~~~~~~~~~~
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
};
var b = {
foo(public x, y) { },
~~~~~~~~
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
a: function foo(x: number, private y: string) { },
~~~~~~~~~~~~~~~~~
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
b: <T>(public x: T, private y: T) => { }
~~~~~~~~~~~
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
~~~~~~~~~~~~
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
}
|