Skip to content

Usage of parameter properties results in incorrect diagnostics #1861

@saulecabrera

Description

@saulecabrera

Using parameter properties outside of a constructor results in an incorrect diagnostic:

class A {
  value: i32 = 0;
  set bet(pubic v: i32) {}
}

This also happens with normal functions and arrow functions and when using private and protected

Actual

The following diagnostic is emitted: ) expected

Expected
Something more informative, such as:

A parameter property is only allowed in a constructor implementation.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions