Closed
Description
TypeScript Version: 2.4.1
Code
export interface Identifiable {
id: string;
}
export function test<T extends Identifiable>(): ReadonlyArray<T> {
const result: ReadonlyArray<Identifiable> = [];
return result;
}
Expected behavior:
Should compile ok.
Actual behavior:
Error: 'Type 'ReadonlyArray<Identifiable>' is not assignable to type 'ReadonlyArray<T>'.
Type 'Identifiable' is not assignable to type 'T'.
```'