Closed
Description
This is broken in the new narrowing for the in
keyword (#15256).
The test inKeywordTypeguard needs to add the following test:
interface StringMap<T> {
[key: string]: T
}
function f(options: StringMap<any>) {
if ('data' in options) {
return options['data'];
}
}
Right now there is an error on options['data']
, but there shouldn't be.