Groovy
  1. Groovy
  2. GROOVY-5126

Arrays.asList(2L,2L) returns incorrect inferred generic type

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta-1
    • Fix Version/s: 2.0-beta-2
    • Component/s: Static Type Checker
    • Labels:
      None

      Description

      The inferred return type for Arrays.asList(2L,2L) is List<Long> but should be List<? extends Long>. If not, then the following code will fail, though it is valid:

      Set<Number> s4 = new HashSet<Number>(Arrays.asList(0L,0L))
      

        Activity

        Cédric Champeau created issue -
        Cédric Champeau made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Paul King made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Mark Thomas made changes -
        Project Import Sun Apr 05 13:32:57 UTC 2015 [ 1428240777691 ]
        Mark Thomas made changes -
        Workflow jira [ 12734050 ] Default workflow, editable Closed status [ 12745772 ]
        Mark Thomas made changes -
        Project Import Mon Apr 06 02:11:23 UTC 2015 [ 1428286283443 ]
        Mark Thomas made changes -
        Workflow jira [ 12971496 ] Default workflow, editable Closed status [ 12979306 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        13d 18h 27m 1 Cédric Champeau 29/Nov/11 04:42
        Resolved Resolved Closed Closed
        24d 22h 25m 1 Paul King 24/Dec/11 03:08

          People

          • Assignee:
            Cédric Champeau
            Reporter:
            Cédric Champeau
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development