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

Fix lambda method ref generation to avoid ambiguous error #1235

Merged
merged 1 commit into from
Mar 9, 2024

Conversation

jjohnstn
Copy link
Contributor

@jjohnstn jjohnstn commented Mar 7, 2024

  • modify ConvertLambdaToMethodReferenceFixCore, LambdaExpressionsFixCore, and LambdaExpressionAndMethodRefFixCore when generating method refs to check if the method ref will be a method argument and if that method is overloaded, add a type cast to prevent an ambiguous error
  • add new tests to CleanUpTest1d8 and AssistQuickFixTest1d8
  • fixes cleanup results in non-compiling code #1047

What it does

Fixes lambda cleanups and assists that create method refs to add a cast when needed to avoid a compiler error saying that the call is ambiguous.

How to test

See original issue and new tests.

Author checklist

@jjohnstn jjohnstn self-assigned this Mar 7, 2024
@jjohnstn jjohnstn added the bug Something isn't working label Mar 7, 2024
@jjohnstn jjohnstn added this to the 4.32 M1 milestone Mar 7, 2024
- modify ConvertLambdaToMethodReferenceFixCore,
  LambdaExpressionsFixCore,
  and LambdaExpressionAndMethodRefFixCore when generating method refs to
  check if the method ref will be a method argument and if that method
  is overloaded, add a type cast to prevent an ambiguous error
- add new tests to CleanUpTest1d8 and AssistQuickFixTest1d8
- fixes eclipse-jdt#1047
@jjohnstn jjohnstn merged commit 678d43e into eclipse-jdt:master Mar 9, 2024
9 checks passed
@jjohnstn jjohnstn deleted the lambdaambiguous branch March 9, 2024 03:49
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
None yet
Development

Successfully merging this pull request may close these issues.

cleanup results in non-compiling code
1 participant