[
https://issues.apache.org/jira/browse/GROOVY-11010?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18140168#comment-18140168
]
ASF GitHub Bot commented on GROOVY-11010:
-----------------------------------------
testlens-app[bot] commented on PR #3257:
URL: https://github.com/apache/groovy/pull/3257#issuecomment-6703568238
## 🚨 All tests passed but jobs failed 🚨
### Failed Jobs without Test Failures
❌ [Build and test / lts \(17,
macos-latest\)](https://github.com/apache/groovy/actions/runs/42346464353/job/128325182068?pr=3257)
🏷️ Commit: 779ff82dbe1720b988544f9a79a20f83aafd51dc
▶️ Tests: 122343 executed
🟡 Checks: 18/25 completed
### Rerun Controls
Click the checkbox to trigger a rerun:
🔲 **Rerun jobs**
---
_Learn more about TestLens at
[testlens.app/docs](https://testlens.app/docs/features/pr-comment/)._
> Ambiguous method reference when expecting a SAM type
> ----------------------------------------------------
>
> Key: GROOVY-11010
> URL: https://issues.apache.org/jira/browse/GROOVY-11010
> Project: Groovy
> Issue Type: Bug
> Components: Static Type Checker
> Reporter: Thodoris Sotiropoulos
> Assignee: Eric Milles
> Priority: Minor
>
> I have the following program
> {code}
> import java.util.function.*;
> class Main {
> static final void test() {
> from(Main::m);
> }
> static <K, V> void from(Function<K, V> f) {}
> static <V> void from(Supplier<V> f) {}
> static int m(String x) { return 1; }
> }
> {code}
> h3. Actual behavior
> {code}
> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup
> failed:
> test.groovy: 6: [Static type checking] - Reference to method is ambiguous.
> Cannot choose between [void Main#from(java.util.function.Supplier<V>), void
> Main#from(java.util.function.Function<K, V>)]
> @ line 6, column 5.
> from(Main::m);
> ^
> 1 error
> {code}
> h3. Expected behavior
> Compile successfully
> h3. Notes
> Tested against master (commit: 5bcd83e0fde722971f97d479f1a4d6da6cd4aa5f)
> Test case adapted from (Guava library)
> {code}
> import java.util.function.*;
> class Main {
> static final void test() {
> com.google.common.cache.CacheLoader.from(Main::m);
> }
> }
> {code}
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)