groovy
  1. groovy
  2. GROOVY-5126

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

    Details

    • Type: Bug Bug
    • Status: Closed 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
    • Number of attachments :
      0

      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

        No work has yet been logged on this issue.

          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: