Skip to content

TS infer type for class static field with error #39797

Closed
@Frezc

Description

@Frezc

TypeScript Version: 3.9.7

Search Terms:

Code

// file a.ts
export class A {
    static foo() {}
}

// file b.ts
import { A } from './a';
export class B extends A {}

// file index.ts
import { B } from './b';
export const foo = B.foo;

Expected behavior:
output declaretion files with no errors.

Actual behavior:

// in index.d.ts
export declare const foo: typeof import("./a").A.foo;
// Namespace '"<build_path>/a"' has no exported member 'A'.ts(2694)

Playground Link:
https://github.com/Frezc/classstatictypeinfer-repro

Related Issues:

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions