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

Eric Milles resolved GROOVY-10359.
----------------------------------
    Fix Version/s: 5.0.0-alpha-10
       Resolution: Fixed

https://github.com/apache/groovy/commit/95e4dbfbeaf0f6bb59222a596c4b5408aacc6d51

It seems most in keeping with the current separation between char and numbers 
to prevent number to char assignment rather than open up char as another number 
type in STC.

> STC misses type error when involving a variable with a char a declared type
> ---------------------------------------------------------------------------
>
>                 Key: GROOVY-10359
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10359
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static Type Checker
>            Reporter: Thodoris Sotiropoulos
>            Assignee: Eric Milles
>            Priority: Minor
>             Fix For: 5.0.0-alpha-10
>
>
> I have the following program
> {code:java}
> class Test {
>   public static void main(String[] args) {
>     char f = (Integer) null;
>   }
> }
> {code}
> h3. Actual behaviour
> groovyc compiles this program
> h3. Expected behaviour.
> groovyc should have rejected this program with an error of the form: 
> {code}
> error: incompatible types: Integer cannot be converted to char
> {code}



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

Reply via email to