Skip to content

private class field declaration generates #private in dts #38050

Closed
@dnalborczyk

Description

@dnalborczyk

TypeScript Version: 3.8.3 and v3.9.0 nightly

repro:

// ts
class FooBar {
    #foo = 'foo'

    bar() {
        return this.#foo
    }
}

Expected behavior:

// dts
declare class FooBar {
    bar(): string;
}

Actual behavior:

// dts
declare class FooBar {
    #private;
    bar(): string;
}

playground:
https://www.typescriptlang.org/play?ts=3.9.0-dev.20200418#code/MYGwhgzhAEBiD28BCYBO0DeAoavoGIAzRaAXmgHJj4Ksc8AjNACgEpN689UBTAFwCuqAHbQ+ACwCWEAHRFEnaAF8sSoA

Related Issues:
#36963
#36640
#36630

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