[
https://issues.apache.org/jira/browse/GROOVY-10858?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17642198#comment-17642198
] Eric Milles edited comment on GROOVY-10858 at 12/16/22 7:57 PM: ---------------------------------------------------------------- https://github.com/apache/groovy/commit/798903b2ef9089ebf8b39ce96eda8b654ae8cdb8 https://github.com/apache/groovy/commit/53ebf7ea411efdca3790595020485d89020f8a00 https://github.com/apache/groovy/commit/c73258ed0c56eb438aecb401e9a2b6bab276b482 https://github.com/apache/groovy/commit/241c694d3091bde4ab206cf9133281e79acd143b https://github.com/apache/groovy/commit/06079d32ecb26c17a3db6b0bc99ea01d1c7c58d1 https://github.com/apache/groovy/commit/be39bea899bce6f108d686c6e49bbe184008182b https://github.com/apache/groovy/commit/02816f2c93954684469a3b7f2ee9aafcdd582251 was (Author: emilles): https://github.com/apache/groovy/commit/798903b2ef9089ebf8b39ce96eda8b654ae8cdb8 https://github.com/apache/groovy/commit/53ebf7ea411efdca3790595020485d89020f8a00 https://github.com/apache/groovy/commit/c73258ed0c56eb438aecb401e9a2b6bab276b482 https://github.com/apache/groovy/commit/241c694d3091bde4ab206cf9133281e79acd143b https://github.com/apache/groovy/commit/06079d32ecb26c17a3db6b0bc99ea01d1c7c58d1 https://github.com/apache/groovy/commit/be39bea899bce6f108d686c6e49bbe184008182b > STC method reference return type checking > ----------------------------------------- > > Key: GROOVY-10858 > URL: https://issues.apache.org/jira/browse/GROOVY-10858 > Project: Groovy > Issue Type: Bug > Components: Static Type Checker > Affects Versions: 3.0.13, 4.0.6 > Reporter: Eric Milles > Assignee: Eric Milles > Priority: Minor > > Consider the following: > {code:groovy} > @groovy.transform.CompileStatic > void test() { > java.util.function.Function<Object,Number> f = Object::toString > print(f.apply('xxx')) > } > {code} > This code compiles and prints the string instead of a compile-time error > indicating that String is not compatible with Number. -- This message was sent by Atlassian Jira (v8.20.10#820010)
