[
https://issues.apache.org/jira/browse/GROOVY-10744?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Paul King closed GROOVY-10744.
------------------------------
> STC support assignment of primitives to interface types like Comparable and
> Serializable
> ----------------------------------------------------------------------------------------
>
> Key: GROOVY-10744
> URL: https://issues.apache.org/jira/browse/GROOVY-10744
> Project: Groovy
> Issue Type: Bug
> Components: Static Type Checker
> Reporter: Eric Milles
> Assignee: Eric Milles
> Priority: Major
> Fix For: 4.0.5, 2.5.19, 3.0.13
>
>
> Consider the following:
> {code:groovy}
> @groovy.transform.TypeChecked
> void test() {
> Serializable x = 0
> Serializable y = 1.2
> Serializable z = Math.PI
> System.err.println(x.class.name)
> System.err.println(y.class.name)
> System.err.println(z.class.name)
> }
> test()
> {code}
> The {{BigDecimal}} literal 1.2 works fine. The other two give an error.
> Dynamic groovy boxes and completes the assignment.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)