Lots of answers for similar questions seem to always be about static classes. This is about instance fields.
Suppose I have this
// File.cs
public partial class Stuff
{
public Stuff()
{
obj.DoSomething();
}
}
// OtherFile.cs
public partial class Stuff
{
MyObject obj = new MyObject("test");
}
Is this guaranteed to be safe? Like it won't do, for example, field initialization and run the constructor in one class, and then do the field initialization in the other part?
Does the C# language guarantee this will always be safe?
Note: Is the "textual order" across partial classes formally defined? does not answer the question. The answer for the current question gives an answer that is not part of such a question. It should not be linked as a duplicate to this particular link.