[)roi(]
Executive Member
- Joined
- Apr 15, 2005
- Messages
- 6,282
Mono 5 is released for:
C# 7 feature list
Release notes
- macOS
- Linux
- Android
- Win64
C# 7 feature list
C# compiler
The Roslyn C# compiler is now available on Mono and it’s called csc. It’s the same compiler available on Windows / Visual Studio with full support for C# 7. Both msbuild and xbuild have been updated to call the csc compiler under the hood instead of mcs.
C# 7 adds a number of new features to the C# language:
out variables:
You can declare out values inline as arguments to the method where they are used.
Tuples
You can create lightweight, unnamed types that contain multiple public fields. Compilers and IDE tools understand the semantics of these types.
Pattern Matching
You can create branching logic based on arbitrary types and values of the members of those types.
ref locals and returns
Method arguments and local variables can be references to other storage.
Local Functions
You can nest functions inside other functions to limit their scope and visibility.
More expression-bodied members
The list of members that can be authored using expressions has grown.
throw Expressions
You can throw exceptions in code constructs that previously were not allowed because throw was a statement.
Generalized async return types
Methods declared with the async modifier can return other types in addition to Task and Task<T>.
Numeric literal syntax improvements
New tokens improve readability for numeric constants.
The new features in C# 7 can also be explored interactively as a Xamarin Workbook.
Release notes
Last edited: