Skip to content

Fix type inferencing and syntax highlighting for assignments in map-based types #1331

@eric-milles

Description

@eric-milles

Consider the following:

import groovy.transform.PackageScope

abstract class A {
  def one
  public two
  protected three
  protected final four
  @PackageScope   five
  private Object  sixx
}
class C extends A {
  @Delegate Map m
  void test() {
    one   = null // set
    two   = null // write
    three = null // write
    four  = null // put
    five  = null // put
    sixx  = null // put
  }
}

The rules of assignment resolution for a map-based type are non-symmetrical (see GROOVY-5001 and GROOVY-5491). Map#put does not take precedence over setter methods, non-final properties and non-final public/protected fields.

image

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions