I can confirm that this is really a mistake. A brief description of what happens here is as follows: in CallBaz, there is one callite that is called three times. This callsite is an InvokeMember because it is the best guess that the compiler can give given the C # syntax, even though it can actually enable GetMember followed by Invoke.
During the second execution of callsite, this is really the binding that the runtime finds. And so it gives a GetMember deferral, followed by a call. The error is that this delay does not limit itself to the case when the argument is an anonymous type. Therefore, in the third execution, the delay is started, and GetMember tries to associate with the program, which, of course, fails.
Thanks for finding this. As Eric points out, we are at a very late stage here, and it becomes difficult for us to fix problems before we set off. But we also want to send the right product. I will do my best to solve this problem, although I will not succeed. If you come up with anything else, feel free to contact me. =)
UPDATE:
Although I canβt guarantee that the final version of VS 2010 and C # 4 will look like when it leaves, I can say that I was able to promote this fix. Today, the escrow build release behaves correctly for your code. Preventing some kind of disaster, you will see that this is fixed upon release. Thanks again. I owe you a beer.
Chris Burrows Feb 22 2018-10-22 16:47
source share