mirror of
https://github.com/hanzoai/prettier.git
synced 2026-10-30 14:46:22 +00:00
9 lines
221 B
JavaScript
9 lines
221 B
JavaScript
// @flow
|
|
|
|
type X = ({a:true} & {b:string}) | ({a:false} & {c:string});
|
|
//type X = {a:true, b:string} | {a:false, c:string}; // this works.
|
|
|
|
function hello(x:X): string {
|
|
if (x.a === true) return x.b; else return x.c;
|
|
}
|