Quick info displays incorrect type in discriminated union type #55495
Labels
Bug
A bug in TypeScript
Domain: Type Display
Bugs relating to showing types in Quick Info/Tooltips, Signature Help, or Completion Info
Effort: Moderate
Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".
Help Wanted
You can do this
Milestone
π Search Terms
quick info, union, discriminated union, wrong info.
π Version & Regression Information
β― Playground Link
https://www.typescriptlang.org/play?#code/C4TwDgpgBAGlC8UDeAoKUB2BDAthAXFAOQBWA9gBYZFQA+xA1lsBDfQM7ABOAlhgOZQAZMgC+KUcKgAKNMjnY8hTrwFSk49AG0GEEMu59+AXUJYMICXXnpFBYuSpE57MngAKXMmEIAjMmQANhDmEnL0qOi2uPZETCzOUVDxEADKkADGPABmPBkA0nqESFAZZACuGMCEGOU4vhBcUJrNKACUKCjSJXaEROYgALR2RAA0UFiEAIzjvoTc5RDjrkpQUwBMAMzNbVDszDzsuRDssJ0A9OdQABJkAG6NUPePAEQrEJ7eLwB0UAAqFGgAEdynkGFA+NkyHssCBTjxgERTv4giEMChLlAAO4UHjBcZ8KDZLAZYAExGnF4DF4yYmBQKnSoAE0eWCgODIXGgYC5OEO7B4DwhGBZAA89jx+NhgOUuW1vl0ejE+o5qMs3B8vD4oAtoKJdvtgIdjqcYJ0UEA
π» Code
π Actual behavior
The quick info prop for
someProp
displaysboolean
as if the object matches the discriminated union. It doesn't, as you can observe from the actual type validationβsomeProp
is stillany
, matching a more permissive index signature.π Expected behavior
The quick info must display
someProp
correctlyβasany
.Additional information about the issue
This is a purely visual issue. The type validation is performed correctly.
The text was updated successfully, but these errors were encountered: