Not. params simply creates an array containing the parameters to pass. This array, like everyone else, is just a collection of variables, and it is impossible to declare a variable of type or t in the ref array. Because of this, only real explicit parameters can be passed as ref or out .
Moreover, if the type is a reference type, it will demonstrate the semantics of the reference type, as usual, which means that any changes made to the object will be reflected in all the code that has access to this link. Only assignments to the actual variable are not reflected.
However, I'm not sure exactly what your code should do. The yield should be followed by a return and the value or break statement that completes the iterator.
source share