Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve flow typing support for !instanceof #978

Closed
eric-milles opened this issue Oct 24, 2019 · 1 comment
Closed

Improve flow typing support for !instanceof #978

eric-milles opened this issue Oct 24, 2019 · 1 comment
Assignees
Milestone

Comments

@eric-milles
Copy link
Member

eric-milles commented Oct 24, 2019

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

@eric-milles eric-milles added this to the v3.6.0 milestone Oct 24, 2019
@eric-milles eric-milles changed the title Fix type inferencing and syntax highlighting for !instanceof flow typing Improve flow typing support for !instanceof Oct 24, 2019
@eric-milles eric-milles self-assigned this Oct 24, 2019
@eric-milles
Copy link
Member Author

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant