Closed
Description
TypeScript Version:
nightly (1.9.0-dev.20160213)
Code
interface Geo {
latlng: [number, number] // tuple
}
function world(geo: Geo) {}
world({ latlng: [35, -112] }); // works fine
let coordinates = { latlng: [35, -112] };
world(coordinates); // errors
let coordinatesTyped: Geo = { latlng: [35, -112] };
world(coordinatesTyped); // works fine
Expected behavior:
Compile without errors.
Actual behavior:
Error, [T]
tuple type information is lost as T[]
:
Type 'number[]' is not assignable to type '[number, number]'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment