Consider this code:
struct Struct { public int Num; }
class Program
{
public void A(ref readonly Struct s) { }
public void B(ref readonly Struct s) => A(ref s);
}
I get a compilation error on this A(ref s), telling me:
CS8329: Cannot use variable as a ref or out value because it is a readonly variable
But the whole point of ref readonly is that you can guarantee it will not be changed. So why can't it be transitive?
Couldn't find helpful info in MSDN.