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

Make AbstractArraySubject compatible with SubjectFactory #148

Closed
benjamin-bader opened this issue Nov 6, 2014 · 2 comments
Closed

Make AbstractArraySubject compatible with SubjectFactory #148

benjamin-bader opened this issue Nov 6, 2014 · 2 comments

Comments

@benjamin-bader
Copy link

In the current release of truth, the following is a compile-time error:

new SubjectFactory<PrimitiveByteArraySubject, byte[]> {
  @Override public PrimitiveByteArraySubject getSubject(FailureStrategy fs, byte[] that) {
    return new PrimitiveByteArraySubject(fs, that);
  }
}

This is unfortunate because (until said subject is released) I'd like to assert_().about(byteArray()), but cannot.

This is because AbstractArraySubject<S extends AbstractArraySubject<S, T>, T> extends Subject<AbstractArraySubject<S, T>, T> and not Subject<S, T>; this is incompatible with the generic bounds of S in SubjectFactory. Changing the supertype to Subject<S, T> solves the problem, and doesn't appear to have any adverse effect.

I have implemented this (trivial) fix and signed a CLA, but before opening a pull request I'm wondering:
a) if the current "behavior" is intended, and
b) whether you the maintainers believe this is worth fixing (I do!).

@kluever
Copy link
Member

kluever commented Nov 7, 2014

Hmm, I'm not sure I see the problem, but sure, go ahead and send a patch! Thanks :)

@benjamin-bader
Copy link
Author

Looks like this was fixed with #149 - thanks much!

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

2 participants