prettier/tests/predicates-declared/orig-string-tag-check.js

13 lines
280 B
JavaScript

// @flow
// The original first-order case
function foo(x: string | Array<string>): string {
if (typeof x === "string") {
return x; // [ERROR] x: Array<string> doesn't match return type
}
else {
return x.join(); // [ERROR] x: string doesn't have .join method
}
}