Skip to content

Improve flow typing support for !instanceof #978

@eric-milles

Description

@eric-milles

Consider the following:

class C {
  Number value
  void meth(that) {
    def val = !(that instanceof C) ? that.toString() : that.value
  }
}

The last occurrence of "value" is showing as unknown (underlined). A similar situation exists for x !instanceof T ? x : x.y and if (x !instanceof T) { ... } else { x.y }

image

See also https://issues.apache.org/jira/browse/GROOVY-8412

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions