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

Paul King closed GROOVY-10087.
------------------------------

> STC does not perform boxing on chars when encountering assignment and 
> function call
> -----------------------------------------------------------------------------------
>
>                 Key: GROOVY-10087
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10087
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static Type Checker
>            Reporter: Thodoris Sotiropoulos
>            Assignee: Eric Milles
>            Priority: Major
>             Fix For: 4.0.0-beta-1, 3.0.9
>
>
> This is related to GROOVY-10079.
> I have the following program
> {code:java}
> public class Main {
>     public static void main(String[] args) {
>       Character c = foo();
>     }
>     public static char foo() {
>       'd' as char
>     }
> }
> {code}
> h3. Expected Behaviour
> Compile successfully
> h3. Actual Behaviour
> {code:java}
> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup 
> failed:
> test.groovy: 3: [Static type checking] - Cannot assign value of type char to 
> variable of type java.lang.Character
>  @ line 3, column 21.
>          Character c = foo();
>                        ^1 error
> {code}
> Tested against master 
> (https://github.com/apache/groovy/commit/2df019d3c93486e8a32d407d364913e7b65e1cba).



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to