eclipse-jdt / eclipse-jdt/eclipse.jdt.ui
Inline produces wrong code when type hint is required
- Dominant language
- Java
- Stars
- 59
- Forks
- 127
- Avg merge
- 22h 47m
- Merged PRs (30d)
- 28
Description
This was initially described here:
- https://github.com/eclipse-jdt/eclipse.jdt.core/issues/1342
Use the following code snippet:
```
public Optional inlineme() {
CompletableFuture> future = CompletableFuture.completedFuture(Optional.empty());
return future.join();
}
```
And choose the quickfix to inline `future` variables results in the following code:
```
public Optional inlineme() {
return CompletableFuture.completedFuture(Optional.empty()).join();
}
```
but this produces a compile error:
> Type mismatch: cannot convert from Optional to Optional
the correct form would be
```
public Optional inlineme() {
return CompletableFuture.> completedFuture(Optional.empty()).join();
}
```
Contributor guide
Assessment
This issue has not been assessed yet.