Order of ReadonlySet/ReadonlyMap in union causes differing key inference #52313
Labels
Bug
A bug in TypeScript
Has Repro
This issue has compiler-backed repros: https://aka.ms/ts-repros
Union Order Dependence
TS behavior is not supposed to depend on union order, but sometimes does
Milestone
Bug Report
π Search Terms
ReadonlyMap ReadonlySet key inference
π Version & Regression Information
β― Playground Link
Playground Link
π» Code
π Actual behavior
The order of the union appears to matter, breaking inference and erroring on valid code. Swapping the union order allows the code to compile.
π Expected behavior
All of this should compile; the union ordering should not matter.
The text was updated successfully, but these errors were encountered: