Skip to content

parameter property's modifier may not be followed by newline #28396

Open
@ajafff

Description

@ajafff

TypeScript Version: has been that way since at least 2.4

Search Terms:

Code

class Foo {
  constructor(public
    foo: string) {}
}

Expected behavior:

Treat is as a parameter property. Or at least document this in the spec (related #28395)

Actual behavior:

Treats it as two parameters with a syntax error because of a missing comma.

Playground Link: https://agentcooper.github.io/typescript-play/#code/MYGwhgzhAEBiD29oG8BQ1rHgOwgFwCcBXYPeAgCgAciAjEAS2HQ2gDNEAuafAh7AOYBKFAF9UooA

Related Issues:

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScript

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions