You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Christopher Smith (Jira)" <ji...@apache.org> on 2023/01/13 22:54:00 UTC

[jira] [Created] (GROOVY-10904) STC doesn't find property accessor on nested class

Christopher Smith created GROOVY-10904:
------------------------------------------

             Summary: STC doesn't find property accessor on nested class
                 Key: GROOVY-10904
                 URL: https://issues.apache.org/jira/browse/GROOVY-10904
             Project: Groovy
          Issue Type: Bug
          Components: Static Type Checker
    Affects Versions: 4.0.7
            Reporter: Christopher Smith


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

{code}
@CompileStatic
class Example {
  static class Profile {
    String name
  }

  Map<String, Profile> PROFILES = [new Profile()]
      .stream()
      .collect(toMap(Profile::getName, identity()))
}
{code}

{code}
Groovy:Failed to find class method 'getName(Example$Profile)' or instance method 'getName()' for the type: Example$Profile
{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)