We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currently, ref fields cannot refer to ref struct types.
ref
ref struct
ref struct R1<T> { } ref struct R2<T> { public ref R1<T> F; // error CS9050: A ref field cannot refer to a ref struct. }
See #62186
See also #62098
The text was updated successfully, but these errors were encountered:
And Allow it recursive:
ref struct ParentIds { int Id; readonly ref ParentIds Parent; }
without
error CS9050: A ref field cannot refer to a ref struct
and
error CS0523: Struct member 'ParentIds.Parent' of type 'ParentIds' cause a cycle in the struct layout
Sorry, something went wrong.
Maybe also introduce something like
ref struct ReadOnlyRefStack<T> { T Item; readonly ref readonly ReadOnlyRefStack<T> Prev; //[...] }
static string Join(ReadOnlySpan<char> seperator, params ReadOnlyRefStack<string> values) => // ...
Closing as this is less a compiler issue and more a language design issue.
cston
No branches or pull requests
Currently,
ref
fields cannot refer toref struct
types.See #62186
See also #62098
The text was updated successfully, but these errors were encountered: