Closed
Description
TypeScript Version: 2.5.2
Code
function func() {}
const array: ArrayLike<any> = func;
See this TypeScript Playground example.
Expected behavior:
I'd have expected an error to be effected.
Actual behavior:
No error is effected if the type ArrayLike<any>
is specified. It seems the absence of an index signature is not a consideration in this situation.
If the any
is changed to, say, string
an error is effected:
Index signature is missing in type '() => void'.