Skip to content

[isolatedDeclarations] parameter property declared in constructor with overload is missing from declaration output #11784

Open
@bradzacher

Description

@bradzacher

Repro

export class Foo {
    constructor(prop: string);
    constructor(readonly prop: string) {}
}

export class Bar {
    constructor(prop: string);
    constructor(prop: string, other: boolean);
    constructor(readonly prop: string, other?: boolean) {}
}

Expected

Same output as TS where the parameter property is hoisted and is declared separate to the constructor:

export declare class Foo {
    readonly prop: string;
    constructor(prop: string);
}
export declare class Bar {
    readonly prop: string;
    constructor(prop: string);
    constructor(prop: string, other: boolean);
}

Actual

The property is omitted entirely:

export declare class Foo {
	constructor(prop: string);
}
export declare class Bar {
	constructor(prop: string);
	constructor(prop: string, other: boolean);
}

playground

Metadata

Metadata

Assignees

Labels

P-highPriority - High

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions