You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by fpavageau <gi...@git.apache.org> on 2015/10/23 15:58:49 UTC

[GitHub] incubator-groovy pull request: GROOVY-7363 Reliable type resolutio...

GitHub user fpavageau opened a pull request:

    https://github.com/apache/incubator-groovy/pull/158

    GROOVY-7363 Reliable type resolution in the static type checker with covariant getters

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/fpavageau/incubator-groovy GROOVY-7363

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-groovy/pull/158.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #158
    
----
commit ff027adbd073b9d65971bf01252611cc2b9fb245
Author: Frank Pavageau <fp...@ekino.com>
Date:   2015-08-03T13:04:37Z

    GROOVY-7363 Add a failing test

commit c5326d43ea155816d336f5d51d93f27980122926
Author: Frank Pavageau <fp...@ekino.com>
Date:   2015-08-03T15:12:00Z

    GROOVY-7363 Change the order of methods so the check fails reliably
    
    It probably depends on the environment (MacOS X 10.10.4, Oracle JDK
    1.7.0u75 here), but at least here the static type checking always fails.
    
    So, moving the setter first creates a reliable failure, and removing it
    makes the check always pass! It makes me think the problem is related to the
    synthetic bridge method generated for ABC.getB() and the order in which the
    methods are returned by the reflection API.

commit a20410f4e0b7d4d482ef87feabecb9f6e83d57ee
Author: Frank Pavageau <fp...@ekino.com>
Date:   2015-10-23T12:31:28Z

    GROOVY-7363 Configure the ClassNode with sorted methods
    
    Because reflection on methods doesn't return them sorted or in any
    particular order, sorting is necessary to get a stable ClassNode definition.
    
    In particular, sorting bridge methods last ensures that the type resolution
    of expressions in the static type checker always uses the covariant return
    type of getters (due to generics, for example) and doesn't lose accuracy,
    resulting in spurious type checking errors.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-groovy pull request: GROOVY-7363 Reliable type resolutio...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-groovy/pull/158


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---