Skip to content

[spec] Parameter properties with question marks and initializers are not clearly specified #541

Closed
@mhegazy

Description

@mhegazy
class C {
     constructor(public x?, public y = 1) { }
}

The spec does not clearly explain whether x and y are optional properties of C. The old compiler treats them as required properties, but optional parameters. I am not sure this makes sense.

Metadata

Metadata

Assignees

Labels

SpecIssues related to the TypeScript language specification

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions