Skip to content

Incorrect semantic highlight of field reference in field initializer expression #520

@eric-milles

Description

@eric-milles

If constructor has a parameter with the same name as a field referenced in an initializer expression, an unknown (underline) semantic highlight is shown incorrectly.

abstract class A {
  protected final String field
  protected A(String field) {
    this.field = field
  }
}

class B extends A {
  Map map = [key: field] // field shown as unknown due to repeat visit of expression as part of ctor
  B(String field) {
    super(field)
  }
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions