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

STC: assign method pointer to SAM-type

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0.19, 4.0.15
    • 3.0.20, 4.0.16
    • Static Type Checker
    • None

    Description

      Consider the following:

      import java.util.function.Consumer
      
      void setX(String string) { }
      Consumer<String> c = this.&setX
      

      With STC enabled, the compiler states Closure<Void> cannot be assigned to Consumre<String>.

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            emilles Eric Milles
            emilles Eric Milles
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment