码迷,mamicode.com
首页 > Windows程序 > 详细

C# 6.0 Feature list

时间:2016-06-13 15:29:57      阅读:210      评论:0      收藏:0      [点我收藏+]

标签:

FeatureExampleC#VB
Auto-property initializers public int X { get; set; } = x; Added Exists
Getter-only auto-properties public int Y { get; } = y; Added Added
Ctor assignment to getter-only autoprops Y = 15 Added Added
Parameterless struct ctors Structure S : Sub New() : End Sub : End Structure Added Added
Using static members using System.Console; … Write(4); Added Exists
Dictionary initializer new JObject { ["x"] = 3, ["y"] = 7 } Added No
Await in catch/finally try … catch { await … } finally { await … } Added No
Exception filters catch(E e) if (e.Count > 5) { … } Added Exists
Partial modules Partial Module M1 N/A Added
Partial interfaces Partial Interface I1 Exists Added
Multiline string literals "Hello<newline>World" Exists Added
Year-first date literals Dim d = #2014-04-03# N/A Added
Line continuation comments Dim addrs = From c in Customers ‘ comment N/A Added
TypeOf IsNot If TypeOf x IsNot Customer Then … N/A Added
Expression-bodied members public double Dist => Sqrt(X * X + Y * Y); Added No
Null propagation customer?.Orders?[5]?.$price Added Added
String interpolation $"{p.First} {p.Lastis {p.Ageyears old." Added* Planned
nameof operator string s = nameof(Console.Write); Added* Planned
#pragma #Disable Warning BC40008 Added Added
Smart name resolution   N/A Added
ReadWrite props can implement ReadOnly   Exists Added
#region inside methods   Exists Added
Overloads inferred from Overrides   N/A Added
CObj in attributes   Exists Added
CRef and parameter name   Exists Added
Extension Add in collection initializers   Added Exists
Improved overload resolution   Added N/A

C# 6.0 Feature list

标签:

原文地址:http://www.cnblogs.com/guangfengli/p/5580484.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!