Skip to content

Commit 51d143d

Browse files
committed
JS: Add test with destructuring pattern that looks like type annotations
1 parent cafbe14 commit 51d143d

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
| ts-test.ts:3:13:3:13 | x | Repeated binding of pattern variable 'x' previously bound $@. | ts-test.ts:3:10:3:10 | x | here |
22
| ts-test.ts:8:16:8:16 | x | Repeated binding of pattern variable 'x' previously bound $@. | ts-test.ts:8:10:8:10 | x | here |
33
| ts-test.ts:11:10:11:10 | x | Repeated binding of pattern variable 'x' previously bound $@. | ts-test.ts:11:7:11:7 | x | here |
4+
| ts-test.ts:21:8:21:13 | string | Repeated binding of pattern variable 'string' previously bound $@. | ts-test.ts:20:8:20:13 | string | here |
45
| tst.js:3:13:3:13 | x | Repeated binding of pattern variable 'x' previously bound $@. | tst.js:3:10:3:10 | x | here |
56
| tst.js:8:16:8:16 | x | Repeated binding of pattern variable 'x' previously bound $@. | tst.js:8:10:8:10 | x | here |
67
| tst.js:11:10:11:10 | x | Repeated binding of pattern variable 'x' previously bound $@. | tst.js:11:7:11:7 | x | here |

javascript/ql/test/query-tests/LanguageFeatures/NonLinearPattern/ts-test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,12 @@ var { x: x, x: y } = o;
1515

1616
// OK
1717
var { p = x, q = x } = o;
18+
19+
function f({
20+
x: string,
21+
y: string // NOT OK
22+
}) {
23+
}
24+
25+
function g({x, y}: {x: string, y: string}) { // OK
26+
}

0 commit comments

Comments
 (0)