Skip to content

Private field has no type in declaration fileΒ #52127

Closed
@plohoj

Description

@plohoj

Bug Report

πŸ”Ž Search Terms

private declaration

πŸ•— Version & Regression Information

  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about and private fields

⏯ Playground Link

Playground link with relevant code

πŸ’» Code

export class UiKitModule {
    private data: string = '123';
    private getData(params?: string): string {
        return this.data;
    }

    forRoot(params?: string): string {
        return this.getData(params) + '4';
    }
    forChild(params?: string): string {
        return this.getData(params) + '5';
    }
}

export class UiKitModuleNativePrivate {
    #data: string = '123';
    #getData(params?: string): string {
        return this.#data;
    }

    forRoot(params?: string): string {
        return this.#getData(params) + '4';
    }
    forChild(params?: string): string {
        return this.#getData(params) + '5';
    }
}

πŸ™ Actual behavior

// Output d.ts
export declare class UiKitModule {
    private data;
    private getData;
    forRoot(params?: string): string;
    forChild(params?: string): string;
}
export declare class UiKitModuleNativePrivate {
    #private;
    forRoot(params?: string): string;
    forChild(params?: string): string;
}

πŸ™‚ Expected behavior

// Output d.ts
export declare class UiKitModule {
    private data: string;
    private getData(params?: string): string;
    forRoot(params?: string): string;
    forChild(params?: string): string;
}
export declare class UiKitModuleNativePrivate {
    forRoot(params?: string): string;
    forChild(params?: string): string;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Working as IntendedThe behavior described is the intended behavior; this is not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions