Browse Source

Âdd a test case for stackalloc in nested context.

pull/2585/head
Siegfried Pammer 4 years ago
parent
commit
12e586b44b
  1. 27
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/CS73_StackAllocInitializers.cs

27
ICSharpCode.Decompiler.Tests/TestCases/Pretty/CS73_StackAllocInitializers.cs

@ -43,6 +43,33 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty @@ -43,6 +43,33 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
}
}
#if CS80
private class NestedContext1
{
public NestedContext1(object result)
{
}
public NestedContext1()
: this(UseNested(GetInt(), stackalloc int[2] {
GetInt(),
GetInt()
}))
{
}
}
public static object UseNested(object a, Span<int> span)
{
return null;
}
public static int GetInt()
{
return 42;
}
#endif
public unsafe string SimpleStackAllocStruct1()
{
StructWithSize5* ptr = stackalloc StructWithSize5[4] {

Loading…
Cancel
Save