Bug: Intellisense shows misleading error when parameter is expected to be a union of an object and a string #45217
Labels
Domain: Error Messages
The issue relates to error messaging
Effort: Moderate
Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".
Experience Enhancement
Noncontroversial enhancements
Help Wanted
You can do this
Rescheduled
This issue was previously scheduled to an earlier milestone
Suggestion
An idea for TypeScript
Milestone
Bug Report
π Search Terms
Intellisense, incorrect function parameter
π Version & Regression Information
Tried with v4.3.5
β― Playground Link
Playground
π» Code
π Actual behavior
The error for
send({ type: "A" })
isType '"A"' is not assignable to type '"B"'
π Expected behavior
The error should be something like the one for
sendOnlyObject
or at least not misleading that the propertytype
has to be"B"
that's what is getting suggested here.The text was updated successfully, but these errors were encountered: