Skip to content

Fix CallBase regression with explicitly implemented interface methods#558

Merged
stakx merged 3 commits into
devlooped:masterfrom
stakx:callbase
Dec 26, 2017
Merged

Fix CallBase regression with explicitly implemented interface methods#558
stakx merged 3 commits into
devlooped:masterfrom
stakx:callbase

Conversation

@stakx

@stakx stakx commented Dec 26, 2017

Copy link
Copy Markdown
Contributor

This fixes #557.

which shows that `CallBase` no longer works for explicitly implemented
interface methods (which appear e. g. when `mock.As<TInterface>()` is
used).
While we could just revert 5837c53, that would reintroduce a slow and
hard to understand multi-line `if` condition. Let's instead rewrite
the original conditions such that no superfluous checks are performed,
and such that fast checks are performed first.

(Notably, checking whether a type is an interface is faster than
checking whether it is a class.)
@stakx stakx merged commit 7e12f34 into devlooped:master Dec 26, 2017
@stakx stakx deleted the callbase branch December 26, 2017 19:41
@devlooped devlooped locked and limited conversation to collaborators Sep 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Callbase not working on latest 4.8 version

1 participant