Closed
Description
Method with delegate invocation problem:
using System;
using System.Runtime.CompilerServices;
public class C {
private MyStruct[] _s = new MyStruct[1];
public void M() {
// Currently this method is not inlined :(
_s[0].TryInvoke();
}
}
public struct MyStruct
{
public Action A;
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void TryInvoke()
{
A();
A();
}
}
category:cq
theme:inlining
skill-level:expert
cost:small