-
Notifications
You must be signed in to change notification settings - Fork 7
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
Incorrect NS3004 for derived types #57
Comments
@samcragg thanks for reporting. I will take a look at this once I am back from holidays. When it comes to Equals and CanCast usages I remember than Nsubstitute does different type checks depending on the context. Can you tell me which version of Nsubstitute you use? |
Cool, thanks for that. I've tried it in both |
…rived-types Gh 57 incorrect ns3004 for derived types
Released in 1.0.4 |
First of all, the analyzer is really useful - thanks for creating the project!
I think I'm incorrectly getting the
Could not set value of type … to argument ... because the types are incompatible
error when trying to assign aDictionary
to aIReadOnlyDictionary
argument and was able to reproduce it with this code:The line with
ci[0] = "string";
triggers the analyser error, however, the test succeeds in passing (i.e. NSubstitute does correctly set the parameter).I think the problem is we're checking if the type is equal instead of if the assignment will work in AbstractCallInfoAnalyzer.cs - maybe
Equals
should be replaced with a call to CanCast?The text was updated successfully, but these errors were encountered: