Open brabeji opened 5 years ago
This is actually an "issue" with the type system, check this out https://github.com/microsoft/TypeScript/issues/15746#issuecomment-301922834.
The current behavior or Record takes the known literal types in K, which in this case is the empty set and creates a type for you, and the resulting type is {}.
Hello @gcanti, I think we may have found a bug in record type.
🐛 Bug report
Current Behavior
https://codesandbox.io/s/frosty-ellis-lynyt?module=/src/index.ts
Expected behavior
The branded type domain should be typed as string.
Reproducible example
https://codesandbox.io/s/frosty-ellis-lynyt?module=/src/index.ts
Suggested solution(s)
Fix typings of
record
Your environment
We <3
io-ts
, thank you!