Last active
November 6, 2021 06:18
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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