Skip to content

instanceof pattern inside lambda causes issues. #2089

Description

@biom4st3r

Using instanceof pattern inside of lambdas breaks multiple features. Examples:

  • hovering over elements stops showing the signature
  • Renaming from inside the method with the pattern pops an internal error (https://pastebin.com/iTZDjVq0)
  • Attempting to Go To Definition of a field or method doesn't work inside the method with the pattern
  • Sometime intellisense stops suggesting things
Environment
  • Operating System: Windows 10 PRO 1909
  • JDK version: Graalvm Java 16 21.1.0
  • Visual Studio Code version: 1.59.1(2021-08-19)
  • Java extension version: v0.81.0

[Please attach a sample project reproducing the error]

public class Test {
    public static final void bug() {
        Optional.empty().ifPresent(o-> {
            if(o instanceof byte[] array) {
                Object local = null;
            }
        });
    }
}

Please attach logs

https://pastebin.com/iTZDjVq0
https://pastebin.com/bc7rGyfE

Additional Informations

Activity

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

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