[flow] Allow type casts in array patterns inside arrow parameters (#9069)

This commit is contained in:
Nicolò Ribaudo
2018-11-24 12:23:49 +01:00
committed by GitHub
parent d2971a1959
commit 856edbf95f
15 changed files with 1801 additions and 6 deletions

View File

@@ -0,0 +1 @@
[a: string];

View File

@@ -0,0 +1,3 @@
{
"throws": "The type cast expression is expected to be wrapped with parenthesis (1:2)"
}

View File

@@ -0,0 +1 @@
([a: string]);

View File

@@ -0,0 +1,3 @@
{
"throws": "The type cast expression is expected to be wrapped with parenthesis (1:3)"
}

View File

@@ -0,0 +1 @@
([a, [b: string]]);

View File

@@ -0,0 +1,3 @@
{
"throws": "The type cast expression is expected to be wrapped with parenthesis (1:7)"
}

View File

@@ -0,0 +1 @@
async ([a: string]);

View File

@@ -0,0 +1,3 @@
{
"throws": "The type cast expression is expected to be wrapped with parenthesis (1:9)"
}

View File

@@ -0,0 +1 @@
async ([a, [b: string]]);

View File

@@ -0,0 +1,3 @@
{
"throws": "The type cast expression is expected to be wrapped with parenthesis (1:13)"
}

View File

@@ -0,0 +1,14 @@
([a: string]) => {};
([a, [b: string]]) => {};
([a: string] = []) => {};
({ x: [a: string] }) => {};
async ([a: string]) => {};
async ([a, [b: string]]) => {};
async ([a: string] = []) => {};
async ({ x: [a: string] }) => {};
let [a: string] = c;
let [a, [b: string]] = c;
let [a: string] = c;
let { x: [a: string] } = c;

File diff suppressed because it is too large Load Diff