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

Fix MemberPath so that it can exclude overriden members #1087

Merged

Conversation

@Evangelink
Copy link
Contributor

commented Jun 24, 2019

Fix #1077

I think that the method IsSameOrInherits should be updated to use IsSubclassOf instead of AssignableFrom to avoid some potential FPs (assignable checks also for cast not only direct inheritance).

@Evangelink Evangelink changed the title Beequivalentto basetype [GH-1077] Fix MemberPath so that it can exclude overriden members Jun 24, 2019

@Evangelink Evangelink force-pushed the Evangelink:beequivalentto-basetype branch from 5125149 to 1f5fb54 Jun 24, 2019

@dennisdoomen dennisdoomen changed the title [GH-1077] Fix MemberPath so that it can exclude overriden members Fix MemberPath so that it can exclude overriden members (1077]) Jun 24, 2019

@dennisdoomen dennisdoomen changed the title Fix MemberPath so that it can exclude overriden members (1077]) Fix MemberPath so that it can exclude overriden members Jun 24, 2019

@Evangelink

This comment has been minimized.

Copy link
Contributor Author

commented Jun 25, 2019

@dennisdoomen What do you think about creating a new PR to change IsAssignableFrom to IsSubclassOf?

@dennisdoomen

This comment has been minimized.

Copy link
Member

commented Jun 25, 2019

What do you think about creating a new PR to change IsAssignableFrom to IsSubclassOf?

I don't quite get why. IsSameOrInherits implies that it'll return true if the type is the same or inherits from it and supports interfaces as well.

@Evangelink

This comment has been minimized.

Copy link
Contributor Author

commented Jun 25, 2019

Current implementation is probably good enough but IsAssignableFrom also handles cast. So if you have type A with property Foo and type B with the same property name and B has the implicit cast operator this would return true.

@jnyrup

jnyrup approved these changes Jun 26, 2019

@dennisdoomen dennisdoomen merged commit fdc2c7d into fluentassertions:master Jun 26, 2019

1 check passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.