[
https://issues.apache.org/jira/browse/GROOVY-11047?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Daniel Sun reassigned GROOVY-11047:
-----------------------------------
Assignee: Daniel Sun
> Fail to catch incompatible return type of lambdas
> -------------------------------------------------
>
> Key: GROOVY-11047
> URL: https://issues.apache.org/jira/browse/GROOVY-11047
> Project: Groovy
> Issue Type: Bug
> Components: Static Type Checker
> Reporter: Thodoris Sotiropoulos
> Assignee: Daniel Sun
> Priority: Minor
> Labels: Lambda
>
> Probably related to GROOVY-10277.
> I have the following program
> {code}
> class Main {
> static final void test() {
> java.util.stream.StreamSupport.<Process>stream(()-> 1, 1, false); //
> Error, the return type of lamba is not compatible with the expected type.
> }
> }
> {code}
> h3. Actual behavior
> The compiler accepts the program
> h3. Expected behavior
> Reject the program with an error of the form: "error: incompatible types: bad
> return type in lambda expression"
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)