Skip to content
This repository was archived by the owner on Sep 1, 2026. It is now read-only.
This repository was archived by the owner on Sep 1, 2026. It is now read-only.

Expando function namespaces are not merged in declaration files #3970

Closed

Description

Steps to reproduce

export function not() {}
not.negate = () => {};
not.toString = () => ' ~ ';

Playground Link

Behavior with typescript@6.0

Single namespace declaration is created for all function properties

export declare function not(): void;
export declare namespace not {
    var negate: () => void;
    var toString: () => string;
}

Behavior with tsgo

Each assignment essentially gets its own namespace declaration

export declare function not(): void;
export declare namespace not {
    var negate: () => void;
}
export declare namespace not {
    var toString: () => string;
}

Activity

  1. jakebailey commented on May 18, 2026

    @jakebailey
    Member

    This is a behavior we largely opted to not bring forward due to the complexity; since this is sort of related to JS d.ts emit expandos, we're currently just emitting namespaces and letting them merge and not doing extra work.

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