Skip to content

src\028-mutability\106-as-const-to-make-functions-infer-a-tuple.problem.ts infers unknown[] instead of any[] #51

@anthonyiu

Description

@anthonyiu

The inference of fetchData() is a bit different from the tutorial. On my IDE, it infers as Promise<unknown[]> instead of Promise<any[]>, which makes the second solution not workable unless I change the second Expect of typeof data to unknown. I'm not sure what's causing the issue but it's a bit confusing.

Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions