-
-
Notifications
You must be signed in to change notification settings - Fork 803
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
Fail when implicit conversion operator renders argument matcher unmatchable #900
Fail when implicit conversion operator renders argument matcher unmatchable #900
Conversation
@michelcedric: With this proposed change, your
with the following message:
Do you think this would be a helpful error message? |
9d8e2c5
to
71ef9e7
Compare
Yes thanks |
src/Moq/MatcherFactory.cs
Outdated
if (argument.NodeType == ExpressionType.Convert) | ||
{ | ||
var convertExpression = (UnaryExpression)argument; | ||
if (convertExpression.Method?.Name == "op_Implicit") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we could take op_Implicit
handling even further and evaluate it if it isn't applied to an argument matcher.
b88e7b3
to
a011ed4
Compare
a011ed4
to
52eaecd
Compare
Closes #897, #898.