Testing C# 9.0 in VS2019 - CS0518 IsExternalInit is not defined or imported ... How do I define/import it?
This is a bug in the current preview and the latest master branch (June 27). A simple record in sharplab.io creates the same error.
Just add the missing type somewhere in your project
namespace System.Runtime.CompilerServices
{
public class IsExternalInit{}
}
Records and init
will work without problem.
Only LinqPad 6 seems to work without problems, probably because it includes that type too