-
Notifications
You must be signed in to change notification settings - Fork 32
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
Not treating Func<T> and Action properly for type compatibility. #290
Comments
EDIT: Ignore the comments below. If I change I'm a bit tired, so I'm probably overlooking something :), but I just tried this out and if I paste
into three different tests (one for each
For the first and the third they pass. If I change the constraint to
(also If I change the function to have a side-effect like |
I can "avoid" calling Assert.That<Func<bool>>(function, Is.Null); |
@mikkelbu I should not have changed the 'code' in the ticket from the code that causes the issue as shown in the PR.
Similar for Action:
Note the difference in behaviour by NUnit itself.
The last call invokes the
|
No problem. I looked at the PR after writing the first comments. I'll take a closer look at the code now. |
The
UnwrapActualType
results in the return type for every delegate.However NUnit doesn't always evaluate its actual parameter.
Only the last one actually calls the function, but we do also evaluate the first.
The same method is called for the other rules testing for incompatible types.
The text was updated successfully, but these errors were encountered: