Skip to content

Instantly share code, notes, and snippets.

@guitarrapc
Last active November 6, 2021 06:18
Show Gist options
  • Save guitarrapc/28d79b2ded824253c724a262204598e0 to your computer and use it in GitHub Desktop.
Save guitarrapc/28d79b2ded824253c724a262204598e0 to your computer and use it in GitHub Desktop.
C# 10 Lambda not has Natural Typeing, return type and Lambda Aatribute. https://ufcpp.net/study/csharp/cheatsheet/ap_ver10/#lambda-improvement
// only work after .NET 6
var x = 0;
var f =
[A]
[return: B]
static int ([C] int x)
=> x;
f(1).Dump(); // 1. not 0.
class AAttribute : Attribute{ }
class BAttribute : Attribute{ }
class CAttribute : Attribute{ }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment