-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
BestMatchingConstructor#typesAreCompatible does type compatibility the opposite way #9
Comments
Thanks! Good catch! Merging to master... do you need this quickly? If yes I can release a new revision, otherwise I'll wait for the next release. |
How far out is the next release? For now I am avoiding using it because of this issue, so I am not blocked. |
I have released https://github.com/davidmarquis/fluent-interface-proxy/releases/tag/fluent-interface-proxy-2.1.2 with your fix, enjoy! |
Awesome! thanks! |
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
On line 124 of BestMatchingConstructor.java, you have the following code:
if (!inputParamType.isAssignableFrom(constructorParamType)) { matches = false; break; }
Shouldn't this comparison be the other way? like so:
if (!constructorParamType.isAssignableFrom(inputParamType)) { matches = false; break; }
It's perfectly fine if the constructor param is a super class or an interface of the inputType, but the other way around will be a compile error. So the net effect of this is that only exact types are allowed, for which there is no work-around if the constructor param is an interface.
The text was updated successfully, but these errors were encountered: