From d10d887996e4b0ac1eed86bb870363d439590233 Mon Sep 17 00:00:00 2001 From: Jorik Schellekens Date: Mon, 25 May 2020 16:53:09 +0100 Subject: [PATCH] Explain unsafe coerce --- src/autocomplete/QueryMatcher.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/autocomplete/QueryMatcher.ts b/src/autocomplete/QueryMatcher.ts index 8c37e63d88..c5fe083d6b 100644 --- a/src/autocomplete/QueryMatcher.ts +++ b/src/autocomplete/QueryMatcher.ts @@ -77,7 +77,8 @@ export default class QueryMatcher { for (const object of objects) { // Need to use unsafe coerce here because the objects can have any // type for their values. We assume that those values who's keys have - // been specified will be string. + // been specified will be string. Also, we cannot infer all the + // types of the keys of the objects at compile. const keyValues: (string)[] = _at(object as any, this._keys) as any; for (const f of this._funcs) {