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

STC: property reference to generated method not recognized

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 5.0.0-alpha-9
    • Static Type Checker
    • None

    Description

      Consider the following:

      class Foo {
        def getBar(bar = 'bar') { bar }
      }
      @CompileStatic
      void test(Foo foo) {
        print foo.bar
      }
      test(new Foo())
      

      Type checker says: "No such property: bar for class: Foo". Methods added by Verifier, like ones for default arguments, are not checked by property resolution.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: