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

test for edge cases in method dispatch #80

Open
6 tasks
Tracked by #74
nikomatsakis opened this issue Jun 1, 2023 · 0 comments
Open
6 tasks
Tracked by #74

test for edge cases in method dispatch #80

nikomatsakis opened this issue Jun 1, 2023 · 0 comments

Comments

@nikomatsakis
Copy link
Member

nikomatsakis commented Jun 1, 2023

PR #73 implemented a new method dispatch algorithm that I believe handles all kinds of edge cases correctly, but we don't have tests for most of them.

Scenarios I think we should test (there are probably more I'm not thinking about)

  • interface Foo extends Bar, Baz -- check that we can call methods on any of those 3 interfaces, even if Bar does not extend Baz; check that we can do it on both an &Foo object and on a impl JavaMethod<Foo> operation
  • Diamond inheritance scenarios or other DAGs
  • Method with a covariant return type defined in a class C that refines the method from a superclass D, invoked on &C
  • Method with a covariant return type defined in a class C that refines the method from an interface I, invoked on &C
  • Method with a covariant return type defined in an interface I that extends another interface J, invoked on an &I
  • Method with a covariant return type defined in an interface I that extends another interface J but invoked on a class C that implements I

I think that about would be pretty good. Note that the last few tests ought to fail until #79 is fixed -- or at least we should be able to make some that do.

This was referenced Jun 1, 2023
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

No branches or pull requests

1 participant