Adriano Carlos Verona
Adriano Carlos Verona
```C# using System.Collections.Generic; var a = new Foo[1]; a[1] = new Foo { data = 42 }; System.Console.WriteLine(MFieldArray(a)); static int MFieldArray(T[] b) where T : Foo => b[0].data; static int...
Cecilifier don´t support capturing variables. For lambda expressions, we detect this scenario and: _i)_ emit a warning and _ii)_ do not generate any code for the lambda expression. We should...
```CSharp using System; class TestStruct { static void Main() { R r = new R(1); } } record R(int Value); ``` Produces (edited for readability) : ```C# //Class : R...
[Documentation](https://github.com/dotnet/csharplang/blob/main/proposals/csharp-12.0/collection-expressions.md) [Example in sharplab](https://sharplab.io/#v2:EYLgtghglgdgPgAQEwEYCwAoBAGABAlAFgG5NMBlABwhgB5YAXAPlwGdIAbDqm3AXlwBtFABokAXVIYAwgHsYrAK5gApgAp2ELjxgBKKZkaDxbThwCCAJ0sQAnvyGiJUuQuXrNXKzdv6yGHXoYZlwOCEsAcxVLHQdhMRFcAGZEwkSAVkSANkSAdkSADklMVyVVNTDI6J0/DENg41DwlSjLbzs4p0SU3DTcTNwc3HzcIpd5MvVKluj23wMMABkoVgYgkI4Vhk7EpG7imQn3AFEYdxtgDimt2swASWXV9ZYoTdWd3D3kg9KTs9ULlc1K8bgsCElnrgVGcPl8kj8jqpTucIJd1NDFLcsIRcL9yoFGCxWLpMABvTAAX38CBxeJUyIBqKB4MhrCQJIw5IwFKAA===)
https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/null-coalescing-operator
See [generated IL](https://cutt.ly/as_operator2)
- [SkipLocalsInit](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/attributes/general#skiplocalsinit-attribute) ```C# class Foo { [System.Runtime.CompilerServices.SkipLocalsInit] static void Test() { var x = new System.DateTime(); Console.WriteLine(x); } } ``` *should not* emit the following line: ```C# md_Test_1.Body.InitLocals = true;...
this should not be too hard. if anyone is interested in picking it up we can pair on it
For instance, see [MethodTestCase](https://github.com/adrianoc/cecilifier/blob/main/Cecilifier.Core.Tests/Tests/Integration/MethodTestCase.cs#L144) To find all known affected tests, search for `issues/227` in the sources
https://github.com/dotnet/csharplang/issues/184 It would be interesting to apply the same optimizations as the C# compiler (it is similar to #222)