Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-11275

Support type witness in method reference

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 4.0.17
    • None
    • Compiler, parser-antlr4
    • None

    Description

      Java permits type witnesses as part of a method reference to provide the usual hinting:

      Optional<List<Number>> foo = Optional.of(42).map(List::<Number>of);
      

      The Groovy grammar as of 4.0.17 does not support type witnesses in this position, but there are a number of cases where the compiler (particularly the STC) has limitations with type inference and it would be helpful to have.

      Attachments

        Activity

          People

            Unassigned Unassigned
            chrylis Christopher Smith
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: