I have two classes like this:
public class test1: BaseClass
{
public test1() : base()
{
}
...
public class BaseClass
{
public BaseClass(
[CallerMemberName]string membername ="",
[CallerFilePath] string path = "")
{
var sf = new System.Diagnostics.StackTrace(1).GetFrame(0);
}
If I specify test1 ctor with call to base - I get membername and path initialized properly, but if not - compiler generates default constructor call, and membername and path are both empty.
Is this a bug or a feature ?
(Visual Studio 2019 16.11.8, net core 3.1 or net 5.0).