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

Cannot find matching method when using generics

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 3.0.11, 3.0.12, 3.0.13
    • None
    • Static Type Checker
    • None

    Description

      I'm having a problem with versions after 3.0.10 when generics is used in return.

      PostgreSQLContainer postgreSQLContainer = new PostgreSQLContainer('postgres:13.4')
            .withDatabaseName(POSTGRESQL_DB)
            .withUsername(POSTGRESQL_USER)
            .withPassword(POSTGRESQL_PASS)
            .withReuse(!IS_JENKINS_BUILD)
            .withTmpFs(['/var/lib/postgresql/data': 'rw']) as PostgreSQLContainer
       
      TcIntegrationSpec.groovy: 34: [Static type checking] - Cannot find matching method org.testcontainers.containers.PostgreSQLContainer#withUsername(java.lang.String). Please check if the declared type is correct and if the method exists.
       @ line 34, column 17.
                     .withUsername(POSTGRESQL_USER)
                         ^ 

      I believe the problem is related to https://issues.apache.org/jira/browse/GROOVY-10054

      Attachments

        1. image-2022-12-13-09-09-35-876.png
          52 kB
          Henrique Mota

        Issue Links

          Activity

            People

              emilles Eric Milles
              henriquemota Henrique Mota
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: