Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support binding types with unresolved interfaces #359

Open
jonpryor opened this issue Aug 8, 2018 · 1 comment
Open

Support binding types with unresolved interfaces #359

jonpryor opened this issue Aug 8, 2018 · 1 comment
Labels
enhancement Proposed change to current functionality generator Issues binding a Java library (generator, class-parse, etc.)

Comments

@jonpryor
Copy link
Member

jonpryor commented Aug 8, 2018

Context:
#358 (comment)

Imagine the following:

public interface Fooable {
}
public class Foo implements Fooable {
}

Further imagine that Foo and Fooable are in separate foo.jar and fooable.jar files, and we attempt to bind only foo.jar.

Should this work?

Offhand, I can't think of any reason why it shouldn't be supportable.

Does this work? No. As a specific example, consider recyclerview-v7-28.0.0-beta01.aar: android.support.v7.widget.RecyclerView is a non-abstract type which implements the interface android.support.v4.view.ScrollingView, which cannot be resolved (as it's in a different .jar file). The RecyclerView type is not bound.

@jpobst jpobst added enhancement Proposed change to current functionality generator Issues binding a Java library (generator, class-parse, etc.) labels Apr 16, 2020
@jonpryor
Copy link
Member Author

There are four scenarios to consider:

Non-abstract Foo and resolvable Fooable: This is what we currently require.

That said, Fooable need not be a public type! If it's a Kotlin internal type or a Java "package-private" type, then Fooable should not be bound. Foo still needs to declare all of the methods from Fooable.

Non-abstract Foo and unresolvable Fooable: We don't need to resolve Fooable, and can skip it. The binding for Foo will mirror Foo.

abstract Foo and resolvable Fooable: We need to"re-declare" all of Fooables methods into the binding of Foo, just as we normally do. That said, Fooable need not be a public type! If it's a Kotlin internal type or a Java "package-private" type, then Fooable should not be bound. Foo still needs to declare all of the methods from Fooable.

abstract Foo and unresolvable Fooable: This is an error. See: #371 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Proposed change to current functionality generator Issues binding a Java library (generator, class-parse, etc.)
Projects
None yet
Development

No branches or pull requests

2 participants