mirror of
https://github.com/hanzoai/prettier.git
synced 2026-09-24 17:02:04 +00:00
10 lines
267 B
JavaScript
10 lines
267 B
JavaScript
// @flow
|
|
|
|
function foo(x: Array<number>): [number, ?number] {
|
|
return x; // Error, can't enforce arity when flowing array to tuple
|
|
}
|
|
|
|
function foo(x: Array<number>): [number, ?number] {
|
|
return [x[0], x[1]]; // OK. This is unsound, but at least arity is enforced
|
|
}
|