#1501·type-fest

ConditionalPick and ConditionalKeys break on types with index signatures

Author: ettmetalCreated Aug 15, 2026Updated Aug 15, 2026
Labelsbug

Bug description

When using ConditionalPick / ConditionalKeys with types which include an index signature for an unknown typed property, the created type will never include any results, unless unknown is passed as a condition, at which point, only those index signature keys will be part of the created type.

Expected behaviour: the created type includes all keys that can be determined at compile time, optionally also including any index signature properties.

Repro

https://www.typescriptlang.org/play/?#code/JYWwDg9gTgLgBDAnmApnA3nAwhAdgE2BmDwEMAbABWAGMBrAGjkqlCOADc0BfOAMygQQcAORJUAWj4oAzjBEBuALAAoVcFwwUUPqRppq9UgCNyadKrhW4YWnRT4AXHDmtcAc1UBICGGJkqOwcAfmdcAFcQY21La1wIGEN7Jww4UjDI6KgmYwyo7ThuVSK1FXEDOxMzAFEAD1JwMzgAXmw8Qn9cCiSAHiSqlCYWNmIuAD5lFQB6KeZK0xQ6hrAm1sxbegdnVw13Jl9O7qD8ULgI-Kg4AB84cIIUPg0HQtV1TW1dfTgAVVwNugGGFiVniiWO2xgbk8Kh8fhIXXIADkEkkQnkssCzgkAOqkd4pVLpM6ZbQ5dEFErWOAAbXsiAhUIAus47nR4gB3XDFV5lZBoX7-AZLRpoVo4AjsAK9AXzMxDVggdjjVQzH5-WWLeoilpnFBcKA8jRaHR6fm4NkQTnY6B0GRAlRU2koekuSG7Zm3c0crkqEqqcpqi1Wm0yYUrUVtCWHQL0Hq-IO4a1QW3ykacNA3VnesYq2bx71J21h1apam1Bnulley24BQ08vEi4erM1uvcIA