swiftlang / swift-java

Apache License 2.0
724 stars 27 forks source link

Java2Swift: Account for covariant overrides so we don't have duplicates #121

Closed DougGregor closed 3 weeks ago

DougGregor commented 3 weeks ago

When we see methods with the same name and parameter types but different result types, check whether the result types are related and only keep the more specialized method.

DougGregor commented 3 weeks ago

It's a little hard to test the effect of this pull request in isolation, because we don't have a good way to test "does not emit this code", but I've marked where in the generated sources we drop a method because it's been subsumed by a covariant override.