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

Static type checking instanceof

    XMLWordPrintableJSON

    Details

      Description

      Now following code failed to compile :

      @CompileStatic
      class Gr {
          void f1(Object obj) {
              if (!(obj instanceof Runnable)) {
                  return
              }
              f3(obj) // failed compiled here  : Cannot find matching method Gr#f3(java.lang.Object). 
          }
      
          void f3(Runnable r) {  }
      }
      

      I have implemented fix and can submit fix, if needed.
      Idea doesn't highlight this code as error, but groovy compiler failed.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                paulk Paul King
                Reporter:
                Nikolas Nikolay Chugunov
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: