-
-
Notifications
You must be signed in to change notification settings - Fork 801
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
C# 7.2 in ValueType
parameters are not supported with .NET Standard / Core
#605
Comments
BTW, just noticed that probably you and NSubstitute should also update our delegate generators. We don't copy the required modifiers as well, so in theory if you have delegate with |
@zvirja - Thanks a lot for that hint! True, this needs to be tested as well. Another thing that comes to mind (which may or may not be relevant to NSubstitute) is that Moq does a lot of Adding these two points to the list above. |
Add .NET Standard 2.0 as a target framework. As it turns out, it appears that Moq doesn't need to add an additional TFM. The upgrade of Castle.Core to version 4.3.0 should be enough. If user code targets a platform that supports .NET Standard 1.5 (or newer), then the .NET Standard 1.5 version of Castle.Core will be selected even though Moq (which sits between Castle.Core and the targeted platform) only has a .NET Standard 1.3 assembly. Possibly update delegate generator logic. Added some tests to verify delegate mocking works in the presence of Check whether DynamicInvoke e.g. for Callback and Returns is already lenient enough given differences in delegate signatures. Ran some quick successful tests; given that |
See this discussion over at DynamicProxy's repo: castleproject/Core#339 (comment).
What needs to be done to add C# 7.2 reference semantics support in Moq for value types is this:
Add .NET Standard 2.0 as a target framework.Not required, see below.Possibly update delegate generator logic, as per C# 7.2Not required, see below.in ValueType
parameters are not supported with .NET Standard / Core #605 (comment).DynamicInvoke
e.g. forCallback
andReturns
is already lenient enough given differences in delegate signatures (presence ofin
parameter modifier), as per C# 7.2in ValueType
parameters are not supported with .NET Standard / Core #605 (comment)The text was updated successfully, but these errors were encountered: