You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
functionfn<TextendsReadonlyArray<string>>(param: T,cb: (element: T[number])=>void){cb(param[0]);// Argument of type 'string' is not assignable to parameter of type 'T[number]'.}
Expected behavior:
Works with Array<string> and ReadonlyArray<string>.
TypeScript Version: 3.5.0-dev.20190427
Follow-up on #30938 @ahejlsberg
Code
Expected behavior:
Works with
Array<string>
andReadonlyArray<string>
.Actual behavior:
Fails with
ReadonlyArray
.Related Issues:
#30938
#31000
The text was updated successfully, but these errors were encountered: