Skip to content

Generic parameters, e.g. in typeof foo<T1, T2> not recognized for typeof types #957

Closed
@ryanrhee

Description

@ryanrhee

TS and JS Grammar Extension version: 0.0.55 / latest

Code

// Please include a code snippet that demonstrates the issue

// this is similar to apollo-client's `useQuery` but simplified for the repro
function useQuery<TData, TVariables>(_vars: TVariables, _data: TData) {
  console.log('hello world')
}

export type UseQuery<TData, TVariables> = typeof useQuery<TData, TVariables>

image

Note the last > - it's red.

This syntax is valid. I believe it's valid as of TS 4.7, from microsoft/TypeScript#47607 .

I've also confirmed that the bug still happens for cases where there's only 1 generic parameter.

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