Skip to content

Instantly share code, notes, and snippets.

@also
Created March 13, 2016 00:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save also/72f0d9530166af3fea1a to your computer and use it in GitHub Desktop.
Save also/72f0d9530166af3fea1a to your computer and use it in GitHub Desktop.
/* @flow */
type T1 = {x : number};
type T2 = {y : number};
type T3 = T1 & T2;
function mergeAndDoStuff(t1 : T1, t2 : T2) : T3 {
const result = Object.assign({}, t1, t2);
console.log(result.info.toString()); // at one time, T1 contained info, but it was removed
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment