Skip to content

GROOVY-7849: Verifier should be aware of array type covariance when c…#346

Merged
asfgit merged 1 commit intoapache:masterfrom
shils:GROOVY-7849
Jun 4, 2016
Merged

GROOVY-7849: Verifier should be aware of array type covariance when c…#346
asfgit merged 1 commit intoapache:masterfrom
shils:GROOVY-7849

Conversation

@shils
Copy link
Copy Markdown
Member

@shils shils commented Jun 3, 2016

…hecking overriding method return types

@blackdrag
Copy link
Copy Markdown
Contributor

+1

@paulk-asert
Copy link
Copy Markdown
Contributor

paulk-asert commented Jun 4, 2016

+1, though I think in fact this also resolves GROOVY-7185, so perhaps add this additional testcase (or similar):

interface A<T> {
    T[] process()
}

class B implements A<String> {
    @Override
    String[] process() {
        ["foo"]
    }
}

class C extends B {
    @Override
    String[] process() {
        super.process()
    }
}

assert new C().process()[0] == 'foo'

then we can resolve that issue as well I believe.

@asfgit asfgit merged commit 7c25c41 into apache:master Jun 4, 2016
asfgit pushed a commit that referenced this pull request Jun 5, 2016
…hecking overriding method return types (closes #346)
@shils shils deleted the GROOVY-7849 branch June 5, 2016 19:30
@shils
Copy link
Copy Markdown
Member Author

shils commented Jun 18, 2016

Just noticed your comment; incidentally I did add a test for GROOVY-7185 (0b33113), though it didn't include an assertion as in your example. Thanks for the suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants