Faked delegates with in parameters don't honor the read-only semantics
See original GitHub issueReported by @zvirja https://github.com/FakeItEasy/FakeItEasy/issues/1338#issuecomment-402251902
Faked delegates with in
parameters don’t honor the read-only semantics of in
, i.e. it’s possible to configure the faked delegate to mutate the parameter:
delegate void Foo(in int x);
...
var foo = A.Fake<Foo>();
A.CallTo(() => foo(A<int>.Ignored)).AssignsOutAndRefParameters(123);
int z = 0;
foo(z);
Console.WriteLine(z); // Should print 0, but prints 123
Issue Analytics
- State:
- Created 5 years ago
- Comments:19 (14 by maintainers)
Top Results From Across the Web
Allow Faking of non-generic types with methods that have in ...
Faking delegates with in parameters works, but the read-only semantics is not honored, e.g. this will print 123: delegate void Foo(in int x);...
Read more >Delegate does not take 9 arguments (FakeItEasy / C# 9.0)
Since you're passing a delegate with 9 parameters, it doesn't match any of the overloads. The compiler assumes (incorrectly) that you're trying ...
Read more >@babel/plugin-proposal-throw-expressions | ...
Intro. Babel is a tool that helps you write code in the latest version of JavaScript. When your supported environments don't support certain...
Read more >smb.conf(5)
This parameter allows Samba to also permit delegation of the control over a point in ... Default: delete readonly = no delete share...
Read more >NFS best practice and implementation guide | TR-4067
This document provides basic concepts, support information, configuration tips, and best practices for NFS in NetApp® ONTAP®. This guide covers the latest ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@blairconrad Thanks for mentioning, was happy to help ☺️
This change has been released as part of FakeItEasy 4.7.1.
Thanks for your help, @zvirja! Look for your name in the release notes. 🏆