function add(num1, num2) {
return num1 + num2;
}
var x = add(3, '0');
console.log(x);
/* @flow */
function add(num1: number, num2: number): number {
return num1 + num2;
}
var x: number = add(3, '0');
console.log(x);
file.js:5
5: var x: number = add(3, '0');
^^^^^^^^^^^ function call
5: var x: number = add(3, '0');
^^^ string. This type is incompatible with
2: function add(num1: number, num2: number): number {
^^^^^^ number
Found 1 error