jquery has batch-only inference error after re-aliasing support (##42284) #42317
Labels
Bug
A bug in TypeScript
Fix Available
A PR has been opened for this issue
Needs Investigation
This issue needs a team member to investigate its status.
Milestone
Notably, this does not show up in the editor. I haven't got it to reproduce outside the jquery project either:
npm test jquery
inside Definitely Typed.tsc
before Support re-aliasing of type alias instantiations #42284 has 12 (expected) errors, whereastsc
afterward has 14 errors.Expected: No error on the argument
events
Actual: Error on the argument
events
: "Argument of type 'string' is not assignable to parameter of type "myEvent"."It looks like TType is inferred as
"myEvent"
instead ofstring
. I can't figure out why. TType should be constrained tostring | number
, since its constraint as written isTType extends keyof TypeToTriggeredEventMap<TDelegateTarget, TData, TCurrentTarget, TTarget>
and TypeToTriggeredEventMap has a string index signature (plus a dozen properties or so).Changing
events
to"myEvent"
gets rid of the error.The text was updated successfully, but these errors were encountered: