groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel.Sun" <sun...@apache.org>
Subject About `char` type in STC
Date Sat, 08 Sep 2018 00:12:23 GMT
Hi all,

       STC can not coerce string with single character to char when passing
parameters, e.g.
```
@groovy.transform.CompileStatic
class Test {
    static s(char delimiter) {}
    
    static void main(String[] args) {
        char a = 'x'   // works
        s(',' as char) // works
        s(',')  // [Static type checking] - Cannot find matching method
Test#s(java.lang.String). 
    }
}

```

        I wonder it is designed on purpose or a bug?

Cheers,
Daniel.Sun




-----
Daniel Sun 
Apache Groovy committer 
Blog: http://blog.sunlan.me 
Twitter: @daniel_sun 

--
Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html

Mime
View raw message