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

ExplicitLambdaArgumentTypes imports the wrong class and collides on name importing. #323

Open
blipper opened this issue Aug 12, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@blipper
Copy link
Contributor

blipper commented Aug 12, 2024

What version of OpenRewrite are you using?

I am using

  • LAtest

What is the smallest, simplest way to reproduce the problem?

package bar;
import foo.A;
class Foo {
    void foo(List<List<buzz.A> asouter) {
           asouter.forEach((asouter) -> {
               asouter.forEach(a) {}
         } 
    }
}

What did you expect to see?

import foo.A;
class Foo {
    void foo(List<List<buzz.A> asouter) {
           asouter.forEach((buzz.A asouter) -> {
               asouter.forEach(buzz.A a) {}
         } 
    }
}

What did you see instead?

import foo.A;
import buzz.A;
class Foo {
    void foo(List<List<buzz.A> asouter) {
           asouter.forEach((A asouter) -> {
               asouter.forEach(A a) {}
         } 
    }
}
}

Somehow the symbols are getting confused and picking form a different package.
This also could be due to nested labmdas where the symbol has a fully qualifed name for a generic in the outer scope and a non-qualified name derived in the inner nested.

What is the full stack trace of any errors you encountered?

 error: a type with the same simple name is already defined by the single-type-import of A
  import buzz.A;
  ^

Are you interested in [contributing a fix to OpenRewrite]Yes

@blipper blipper added the bug Something isn't working label Aug 12, 2024
@timtebeek timtebeek moved this to Backlog in OpenRewrite Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Backlog
Development

No branches or pull requests

1 participant