C# 7

I noticed the new .NET 4.6 mode only supports C# 6 by default. Is there any way to enable C# 7 support?

1 Like

Bumb that, C# 7 rocks.

Note however that you can already use most of the C# 7 features if you compile your code into a library inside VS 2017. Out variables, pattern matching, local functions all work out of the box. I haven’t tested tuples but they should work (as noted here) if you import the System.ValueTuple package.

2 Likes

I’d like to use C#7 in Unity too. Return by ref is a really nice language feature for optimization. At this rate we are just going to get another outdated C# version as the new default

2 Likes

Seconded, C# 7 is better than 4,5 & 6 together.

Mono only recently introduced c# 7 support, so time is needed to let it stabilize then integrate, test and move things forward. Now that we’re working more closely with the .Net Foundation, expect things to move faster - however this topic is not pertinent to this beta.

3 Likes

Sounds cool to me, confirms what I thought that the long period where the mono/.NET side of things was in a sort of limbo (apart from IL2CPP) was due to factors that are now gone and so is now well behind us :slight_smile:

ETA for c# 7 (after Unity 2017 gets released)?

No ETA other than we’ll be working on it and getting it stable from our side.

2 Likes