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

Eric Milles resolved GROOVY-10107.
----------------------------------
    Fix Version/s: 4.0.0-beta-1
       Resolution: Fixed

> Cannot assign null to a variable with a bounded generic type
> ------------------------------------------------------------
>
>                 Key: GROOVY-10107
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10107
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static Type Checker
>            Reporter: Thodoris Sotiropoulos
>            Assignee: Eric Milles
>            Priority: Major
>             Fix For: 4.0.0-beta-1
>
>
> I have the following program
> {code:java}
> final class Test<T extends Number> {
>   final void m() {
>     T v = null;
>   }
> }
> {code}
> h3. Actual Behaviour
> {code:java}
> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup 
> failed:
> test.groovy: 5: [Static type checking] - Cannot assign value of type <unknown 
> parameter type> to variable of type T
>  @ line 5, column 11.
>        T v = null;
>              ^1 error
> {code}
> h3. Expected Behaviour
>  
> Tested against master 
> https://github.com/apache/groovy/commit/7a56d7130aaf7b5244fa5a82fa0505fb7509f51f



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to