7 ms·
There are a few language features which require a specific type to be defined, but you can define those types yourself. For example, to use record syntax, you
by linknoid 5y ago
There are a few language features which require a specific type to be defined, but you can define those types yourself.
For example, to use record syntax, you need to define this attribute:
namespace System.Runtime.CompilerServices { public class IsExternalInit : Attribute { } }
And supporting the new indexing syntax requires you to define System.Index and System.Range types, which are a bit more involved, but still pretty trivial:
https://docs.microsoft.com/en-us/dotnet/api/system.index?view=net-5.0 https://docs.microsoft.com/en-us/dotnet/api/system.index?vie...
https://docs.microsoft.com/en-us/dotnet/api/system.range?view=net-5.0 https://docs.microsoft.com/en-us/dotnet/api/system.range?vie...
But pretty much all the other new C# language features I've tried have just worked straight out of the box with .NET 4.7.2.