Conversation
Covers ref structs implementing interfaces (implicit, explicit, and default-interface-method reimplementation, which CS9245 forces on every ref struct implementer), the allows ref struct anti-constraint on methods, classes, interfaces, delegates, local functions, iterators, async methods, and capturing local functions, constraint combinations (interface, IDisposable with using, unmanaged, struct, new()), interface members invoked through a constrained T (instance, static abstract factory, and default interface methods, which are callable through T because implementers must always override them), scoped/ref/ in/out parameters of T, and call sites instantiating with Span/ ReadOnlySpan type arguments. The test is green in all four Roslyn 4.14/latest debug/opt configs: the decompiler already round-trips the gpAcceptByRefLike flag into "allows ref struct" clauses and re-emits ref struct interface implementations correctly. One cosmetic quirk is pinned as-is: calls whose type arguments are ref structs are printed with explicit type arguments and a declaring-type qualifier even within the declaring class, because type-argument inference validation does not accept ref struct type arguments; the output remains compilable and semantically identical. Assisted-by: Claude:claude-fable-5:Claude Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Covers ref structs implementing interfaces (implicit, explicit, and default-interface-method reimplementation, which CS9245 forces on every ref struct implementer), the allows ref struct anti-constraint on methods, classes, interfaces, delegates, local functions, iterators, async methods, and capturing local functions, constraint combinations (interface, IDisposable with using, unmanaged, struct, new()), interface members invoked through a constrained T (instance, static abstract factory, and default interface methods, which are callable through T because implementers must always override them), scoped/ref/ in/out parameters of T, and call sites instantiating with Span/ ReadOnlySpan type arguments.
The test is green in all four Roslyn 4.14/latest debug/opt configs: the decompiler already round-trips the gpAcceptByRefLike flag into "allows ref struct" clauses and re-emits ref struct interface implementations correctly. One cosmetic quirk is pinned as-is: calls whose type arguments are ref structs are printed with explicit type arguments and a declaring-type qualifier even within the declaring class, because type-argument inference validation does not accept ref struct type arguments; the output remains compilable and semantically identical.
Assisted-by: Claude:claude-fable-5:Claude Code