We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e581649 commit 2200d35Copy full SHA for 2200d35
tests/cases/conformance/es6/restParameters/readonlyRestParameters.ts
@@ -0,0 +1,29 @@
1
+// @strict: true
2
+// @declaration: true
3
+
4
+function f0(a: string, b: string) {
5
+ f0(a, b);
6
+ f1(a, b);
7
+ f2(a, b);
8
+}
9
10
+function f1(...args: readonly string[]) {
11
+ f0(...args); // Error
12
+ f1('abc', 'def');
13
+ f1('abc', ...args);
14
+ f1(...args);
15
16
17
+function f2(...args: readonly [string, string]) {
18
+ f0(...args);
19
20
21
22
+ f2('abc', 'def');
23
+ f2('abc', ...args); // Error
24
+ f2(...args);
25
26
27
+function f4(...args: readonly string[]) {
28
+ args[0] = 'abc'; // Error
29
0 commit comments