Skip to content

type alias is resolved in function type causing type to be unnamable #1784

@dragomirtitian

Description

@dragomirtitian

Steps to reproduce

// @filename: types.ts
interface BaseDefinition {
    id: string;
}

export type Definition = BaseDefinition;

// @filename: index.ts

import { Definition } from "./types";
export const fn = (def: Definition) => { }

Playground link

Behavior with typescript@5.8

Declaration for index.d.ts is emitted as export declare const fn: (def: Definition) => void

Behavior with tsgo

We get an error: Exported variable 'fn' has or is using name 'BaseDefinition' from external module "project/generic/types" but cannot be named.

Possibly related to: #1741

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