You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2022/12/19 14:41:00 UTC

[jira] (GROOVY-10868) Cannot find matching method when using generics

    [ https://issues.apache.org/jira/browse/GROOVY-10868 ]


    Eric Milles deleted comment on GROOVY-10868:
    --------------------------------------

was (Author: emilles):
PostgreSQLContainer uses a self-referential type parameter. You are providing no type argument. There are some closed tickets about this kind of thing. I don’t have the numbers at hand. 

> Cannot find matching method when using generics
> -----------------------------------------------
>
>                 Key: GROOVY-10868
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10868
>             Project: Groovy
>          Issue Type: Improvement
>          Components: Static Type Checker
>    Affects Versions: 3.0.11, 3.0.12, 3.0.13
>            Reporter: Henrique Mota
>            Priority: Major
>         Attachments: image-2022-12-13-09-09-35-876.png
>
>
> I'm having a problem with versions after 3.0.10 when generics is used in return.
> {code:java}
> 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
>  {code}
> {code:java}
> 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)
>                    ^ {code}
> !image-2022-12-13-09-09-35-876.png!
> I believe the problem is related to https://issues.apache.org/jira/browse/GROOVY-10054



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