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

STC: no type check error for invalid method pointer or reference

    XMLWordPrintableJSON

    Details

      Description

      Consider the following:

      @groovy.transform.TypeChecked
      void test() {
        def closure = String.&toLowerCaseX
        java.util.function.Function<String,String> reference = String::toLowerCaseX
      }
      

      Neither of these misspellings result in a compiler error. Also no metadata is saved in the AST to understand what method is being referenced if the names are fixed.

        Attachments

          Activity

            People

            • Assignee:
              emilles Eric Milles
              Reporter:
              emilles Eric Milles
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: