lichess-org / lichobile

lichess.org mobile application
https://lichess.org/mobile
GNU General Public License v3.0
2.03k stars 318 forks source link

Compiling fails due to TypeScript TS2345 #706

Closed genbucactus closed 6 years ago

genbucactus commented 6 years ago

The function rookFileOf in src/chessground/premove.ts uses a Key in the map function and apparently this is causing builds to fail for me.

This line: .map((key: Key) => util.key2pos(key)[0])

Results in this: Error TS2345: Argument of type '(key: Key) => Coord' is not assignable to parameter of type '(value: string, index: number, array: string[]) => Coord'. Types of parameters 'key' and 'value' are incompatible. Type 'string' is not assignable to type 'Key'.

This is on MacOS. I've tried with the latest version of TypeScript, the minimum recommended version, and older versions.

veloce commented 6 years ago

Try pull last master, rm -r node_modules && npm i

genbucactus commented 6 years ago

It is working now -- thank you!