Skip to content

Contextual typing is wrong in nested function calls. #62680

@dpeter99

Description

@dpeter99

🔎 Search Terms

I have run into the following issue while working on a schema lib.
https://tsplay.dev/w1eekw
The type of varaible d is any for some reason, at line 78.
On the discord it was suggested that this is a compiler bug.
https://discord.com/channels/508357248330760243/1428318052205854720/1432271574689517660

🕗 Version & Regression Information

  • This is the behavior in every version I tried: 5.9.3, 5.8.3, 5.7.3

⏯ Playground Link

https://tsplay.dev/w1eekw

💻 Code

// Your code here

🙁 Actual behavior

The type of the d param in the lambda is any.

🙂 Expected behavior

It should be of type User

Additional information about the issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Design LimitationConstraints of the existing architecture prevent this from being fixed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions