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

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
@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
Copy link
Contributor Author

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

@dennisdoomen
Copy link
Member

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
Copy link
Contributor Author

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.

@dennisdoomen dennisdoomen merged commit fdc2c7d into fluentassertions:master Jun 26, 2019
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

Successfully merging this pull request may close these issues.

Excluding not functioning on overriden linked property
3 participants