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

Erroneous NS1002 errors for Arg.Any calls #91

Closed
ksstott opened this issue Apr 11, 2019 · 3 comments · Fixed by #92
Closed

Erroneous NS1002 errors for Arg.Any calls #91

ksstott opened this issue Apr 11, 2019 · 3 comments · Fixed by #92
Assignees
Labels
bug Something isn't working
Milestone

Comments

@ksstott
Copy link

ksstott commented Apr 11, 2019

I've got some code like this:

var myMock = Substitute.For<IDependancy>();
myMock.When(a => a.Foo(Arg.Any<SomeClass>())).Throw(new Exception());

Since updating to version 1.0.8 we're getting the following error on the .When line.

error NS1002: Member Any can not be intercepted. Only interface members and virtual, overriding, and abstract members can be intercepted.

@tpodolak tpodolak added the bug Something isn't working label Apr 11, 2019
@tpodolak
Copy link
Member

@ksstott thanks for reporting, looks like this is regression after the last changes which were aiming to fix #89 Will try to look at this today. If this is not a problem please downgrade for now to 1.0.7

@tpodolak
Copy link
Member

tpodolak commented Apr 11, 2019

@ksstott fix is on the way. If everything will be ok, I will release it either tonight or tomorrow morning

@tpodolak tpodolak added this to the 1.0.9 milestone Apr 11, 2019
tpodolak added a commit that referenced this issue Apr 11, 2019
[GH-91] - better checks for when symbols usage
@tpodolak
Copy link
Member

Fix released in 1.0.9

@tpodolak tpodolak unpinned this issue Aug 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants