Skip to content

Generic Type Infer Failed #2322

@HerrCai0907

Description

@HerrCai0907
// index.ts
import * as lib from "./lib";
export function test(): void {
  lib.test(new lib.Wrapper<i32>());
}
// lib.ts
export function test<T = i32>(t: Wrapper<T>): void {}
export class Wrapper<T> {
  v: T;
}

It will receive this error

ERROR TS2304: Cannot find name 'Wrapper'.

 export function test<T = i32>(t: Wrapper<T>): void {}
                                  ~~~~~~~
 in assembly/lib.ts(1,34)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions