[ 
https://issues.apache.org/jira/browse/GROOVY-10436?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Eric Milles updated GROOVY-10436:
---------------------------------
    Fix Version/s:     (was: 5.0.0-alpha-1)

> STC: closure parameter type-checking: declared vs inferred
> ----------------------------------------------------------
>
>                 Key: GROOVY-10436
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10436
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static Type Checker
>    Affects Versions: 4.0.0-rc-2, 3.0.12
>            Reporter: Eric Milles
>            Assignee: Eric Milles
>            Priority: Major
>             Fix For: 3.0.12, 4.0.4
>
>
> Consider the following:
> {code:groovy}
> import java.util.function.Consumer
> def <T> T m(Consumer<? super T> c) {
>   // ...
> }
> @groovy.transform.TypeChecked
> void test() {
>   this.m { Number n ->
>     def big = n.toBigInteger()
>   }
> }
> {code}
> Recent fixes for closure param STC (GROOVY-8917, GROOVY-10049, GROOVY-10053, 
> etc.) are producing an error for the param "expected Object actual Number" 
> and an error for the call expression "cannot find method 
> Object#toBigInteger()".
> {{StaticTypeCheckingVisitor#inferClosureParamterTypes}} does not use closure 
> expressions to determine placeholder types and there are no other type 
> witnesses.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to