我試圖定義一個函數簽名在flow。我期望以下代碼拋出一個錯誤但我沒有得到任何錯誤呢?流程和函數定義
// function that applied a function to an array - just for numbers
const arrayMath = (func:() => number, arr: Array<number>):Array<Number> => arr.map(func);
// would expect this function to work OK with arrayMath
const square = (num: number): number => num * num;
// would expect this function to fail with arrayMath
const concatX = (str: string): string => `${str}X`;
// flow is not giving me an error here..
arrayMath(concatX, [1, 2, 3]);
試着在這裏執行代碼https://flow.org/try/ – Kasiriveni