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/11/26 16:26:09 UTC

[GitHub] incubator-groovy pull request: GROOVY-7538 Bound unbounded wildcar...

GitHub user fpavageau opened a pull request:

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

    GROOVY-7538 Bound unbounded wildcards using the type declaration

    If there is a type declared with bounds, for example
    
        class NumberList<T extends Number> implements List<T>
    
    but used with an unbounded wildcard
    
        NumberList<?> getList()
    
    the bounds are actually implicit and need to be taken into account for the
    static type checks, to be able to use the type of the parameter directly:
    
        getList()[0].longValue()
    
    The type of the element is known to be `Number`, not `Object`.

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

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

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

    https://github.com/apache/incubator-groovy/pull/197.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 #197
    
----
commit 0f9fca72cefc9372ea9c3b33eef5b80f3cf7585f
Author: Frank Pavageau <fp...@ekino.com>
Date:   2015-11-26T15:12:09Z

    GROOVY-7538 Bound unbounded wildcards using the type declaration
    
    If there is a type declared with bounds, for example
    
        class NumberList<T extends Number> implements List<T>
    
    but used with an unbounded wildcard
    
        NumberList<?> getList()
    
    the bounds are actually implicit and need to be taken into account for the
    static type checks, to be able to use the type of the parameter directly:
    
        getList()[0].longValue()
    
    The type of the element is known to be Number, not Object.

----


---
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-7538 Bound unbounded wildcar...

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

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


---
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.
---