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

STC doesn't find property accessor on nested class

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.0.7
    • 5.0.0-alpha-1
    • Static Type Checker
    • None

    Description

      The STC appears unable to see the property accessor for a nested class.

      @CompileStatic
      class Example {
        static class Profile {
          String name
        }
      
        Map<String, Profile> PROFILES = [new Profile()]
            .stream()
            .collect(toMap(Profile::getName, identity()))
      }
      
      Groovy:Failed to find class method 'getName(Example$Profile)' or instance method 'getName()' for the type: Example$Profile
      

      Attachments

        Activity

          People

            emilles Eric Milles
            chrylis Christopher Smith
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: