JS: Add test with destructuring pattern that looks like type annotations

This commit is contained in:
Asger Feldthaus
2020-06-15 16:35:36 +01:00
parent cafbe14dc8
commit 51d143d6f1
2 changed files with 10 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
| 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 |
| 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 |
| 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 |
| 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 |
| tst.js:3:13:3:13 | x | Repeated binding of pattern variable 'x' previously bound $@. | tst.js:3:10:3:10 | x | here |
| tst.js:8:16:8:16 | x | Repeated binding of pattern variable 'x' previously bound $@. | tst.js:8:10:8:10 | x | here |
| tst.js:11:10:11:10 | x | Repeated binding of pattern variable 'x' previously bound $@. | tst.js:11:7:11:7 | x | here |

View File

@@ -15,3 +15,12 @@ var { x: x, x: y } = o;
// OK
var { p = x, q = x } = o;
function f({
x: string,
y: string // NOT OK
}) {
}
function g({x, y}: {x: string, y: string}) { // OK
}