Skip to content

@private on constructor function in a block causes crash #35766

@sandersn

Description

@sandersn

Crashes when inside a block, but not at toplevel.

{
    /** @private */
    function C() {
        this.x = 1
    }
    new C()
}

Introduced in the recent PR that supports @private in jsdoc.
Behaviour is incorrect at top-level too; @private on a constructor function doesn't make sense, but the compiler gives an error on new C() saying that it can only be constructed inside the class itself. But there is nowhere else to construct the class?

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptCrashFor flagging bugs which are compiler or service crashes or unclean exits, rather than bad outputFix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions