Skip to content

When a non-generic value and a generic type shares the same name 'X', "Type 'X' is not generic." #65389

Open

Description

🔎 Search Terms

Not sure of the vocabulary to use here.
Tried to use IA to find relevant issue, didn't found any.

🕗 Version & Regression Information

  • Tested in version 6.0.3

⏯ Playground Link

I'm not sure how to use several files in the playground.

💻 Code

// XContract.ts
export type X<T> = {foo: T};

// X.ts
import type {X} from "./XContract";
const X = class <T> implements X<T>{ foo!: T };

export {X};

// use.ts
import {X} from "./X.ts";
type Z = X<number>;

🙁 Actual behavior

Le type 'X' n'est pas générique.ts(2315)

TS seems confused, checking whether the value has generic parameters when it should check the type...

🙂 Expected behavior

No errors.

Additional information about the issue

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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