Consider the following alternative implementations that derived, internal classes are intended to override, returning true
:
public virtual bool IsInternal => false;
...and...
public virtual bool IsInternal() => false;
What is the difference memory- and performance-wise?
Can the compiler detect the static results and, when optimizing/inlining, use them instead of saving the property value for each instance or invoking the function? Can these virtual members be inlined by the compiler at all and what would the impact be?