TypeScript Version: 2.3.1, 2.4.0-dev.20170427
Code
typeFoo={foo: string}typeBar={bar: string}typeBaz={baz: string}typeFBB=Foo|Bar|Bazdeclareconstobj: FBBconstFbbComponent=(props: FBB)=>(<div>{JSON.stringify(props)}</div>)constcomp1=React.createElement(FbbComponent,{ ...obj})// worksconstcomp2=<FbbComponent{...objasFoo}/>// worksconstcomp3=<FbbComponent{...obj}/>// does not workExpected behavior:
Compiles without errors
Actual behavior:
Error:
Type '{}' is not assignable to type '(IntrinsicAttributes & Foo) | (IntrinsicAttributes & Bar) | (IntrinsicAttributes & Baz)'.
Type '{}' is not assignable to type 'IntrinsicAttributes & Baz'.
Type '{}' is not assignable to type 'Baz'.
Property 'baz' is missing in type '{}'.
TypeScript Version: 2.3.1, 2.4.0-dev.20170427
Code
Expected behavior:
Compiles without errors
Actual behavior:
Error: