Original C# using top-level statements
// See https://aka.ms/new-console-template for more information
var a = 2;
int s = 0;
var inc = (int x) => s = x + 1;
var c = inc(a);
Console.WriteLine("c={0} s={1}", c ,s); // c=3 s=3
Lowered C#
// Decompiled with JetBrains decompiler
// Compiler-generated code is shown
using System;
using System.Runtime.CompilerServices;
[CompilerGenerated]
internal class Program
{
private static void <Main>$(string[] args)
{
Program.<>c__DisplayClass0_0 cDisplayClass00 = new Program.<>c__DisplayClass0_0();
int num = 2;
cDisplayClass00.s = 0;
Console.WriteLine("c={0} s={1}", (object) new Func<int, int>((object) cDisplayClass00, __methodptr(<<Main>$>b__0))(num), (object) cDisplayClass00.s);
}
public Program()
{
base..ctor();
}
[CompilerGenerated]
private sealed class <>c__DisplayClass0_0
{
public int s;
public <>c__DisplayClass0_0()
{
base..ctor();
}
internal int <<Main>$>b__0(int x)
{
return this.s = x + 1;
}
}
}