let c = { [X in keyof { "foo" }]: { foo: "bar" } extends { X } ? true : false }["foo"];
let d = { foo: "bar" } extends { "foo" } ? true : false;
c
and d
should both return true
, but surprisingly, c
is evaluated as false
.
Can anyone help shed light on this discrepancy? Perhaps it's a TypeScript issue?
Please note that this was tested with TypeScript version 4.4.4.