eclipse-jdt / eclipse-jdt/eclipse.jdt.core

TypeMismatch in functional results

Open
#4,157 13 comments 0 reactions 0 assignees View on GitHub
compiler javac
Dominant language
Java
Stars
237
Forks
195
Avg merge
1d 12h
Merged PRs (30d)
47

Description

This example taken form the original API documentation for StackWalker compiles without any warnung and works well with command line Compilers.
But it shows an errort "`Type mismatch: cannot convert from Object to Optional`" in the java editor.

```
StackWalker walker = StackWalker.getInstance(Option.RETAIN_CLASS_REFERENCE);
Optional> walk2 = walker.walk(s -> s.map(StackFrame::getDeclaringClass).findFirst());

```
Eclipse Version 2025-06 (4.36.0)
Build id: 20250605-1316
On Windows 10
With Eclipse builtin Java Version

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.