Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which features of C# 7.0 are available in VS "15" Preview?

As you know in build 2016 conference, next version of visual studio was introduced as Visual Studio Enterprise “15” Preview. I downloaded ISO of this preview to check out C# 7.0 new features. As was said in C# presentation session on build conference, I added __DEMO__ and __DEMO_EXPERIMENTAL__ conditional compilation symbols to my project. Now I got these features working:

  • Local Functions
  • Digit Separators
  • Binary Literals
  • Pattern Matching

But these two do not working and build fails with errors:

  • Ref Returns and Ref Locals
  • Tuple Literal Syntax

Can you help me why I can not test these two last feature?

like image 287
MV VM Avatar asked Apr 12 '16 10:04

MV VM


2 Answers

As of today, April 12, 2016 @ 12:16 PM (CDT) the tuple feature is in its "prototyping" phase and not yet available. This is regardless of the conditional compilation symbols. Please check out the Roslyn language feature status for details on C# 7.0.

Actually, in looking more closely at the list -- it seems as though pattern matching is in "prototyping" too, which means I must stand corrected. If that is the case, then you should be able to pull down the Roslyn compiler locally from the tuple branch found here. Then use this build to compile your experimental code as defined here.

like image 121
David Pine Avatar answered Nov 02 '22 14:11

David Pine


Visual Studio 15 Preview will only let you play with some of the proposed features of C# 7.0, more specifically:

  • local functions
  • digit separators
  • binary literals
  • ref returns
  • and pattern matching

Basically the stuff you already mentioned. Here is the source. It's unclear when the others will be made available.

like image 22
async Avatar answered Nov 02 '22 13:11

async