microsoft/typescript-go

tsgo does not use assertion as a source for the type of a default export.

Opened this issue · 0 comments

Steps to reproduce

// @filename: source.ts
class Foo<T> {
    #p!: T;
}

interface Bar {
    value: number
}

export default new Foo<Bar>();


// @filename: index.ts
import foo from './source';

// Error in tsgo
export default {
    foo
} as {
    foo: typeof foo
}

Playground

Behavior with typescript@5.8

The type for _default uses the type from the assertion.

Behavior with tsgo

Assertion types are ignored and we get the error: Default export of the module has or is using private name 'Bar'. (also happens to other variables)