You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 6fe0714
Browse filesBrowse the repository at this point in the historyBrowse files
committed
Report ST009 and ST023 for constructors and assembly registrations
UnsafeSignatureAnalyzer only looked at the overridable and interface
members of the stunts asked for by a call, so two paths still failed
inside generated code with no Stunts diagnostic:
- A compile-time stunt intercepts each accessible constructor of its
base class, with the same holders and unsafe code as a method. The
analyzer now walks those constructors, unless compile-time stunts are
explicitly off: run-time stunts do not intercept constructors.
- A stunt asked for with [assembly: Stunt<T>] was never analyzed. The
registration attributes of the assembly are now analyzed too, and the
diagnostic is reported at the attribute. The check that recognizes the
attribute moves to SymbolExtensions.IsRegistrationAttribute, shared
with the generator.
Delegate stunts are left out on purpose: DelegateScaffold passes the
arguments of Invoke to MethodInvocation.Create without holders, so a ref
struct in a delegate signature fails with CS9244 under any setting, and
the fixes ST009 and ST023 name would not help.
With registrations covered, the ST015 warning about ref structs repeats
ST023, an error: it is removed with its cache flag, its rows in the
docs, and the by-ref-like generics input of the fingerprint, which only
that check read.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-authored-by: CodeAlta <noreply@codealta.io>
|`ST015`| Generic intercepted methods use run-time `MakeGenericMethod`| Use non-generic members with closed parameter and return types |
39
-
|`ST015`| Ref-struct interception needs by-ref-like generics | Target .NET 9 or later, with C# 13 or later |
40
39
|`ST015`|`IQueryable` defaults require dynamic code | Register an AOT-compatible typed `DefaultValueProvider` factory, or avoid `DefaultValueBehavior` for that member |
41
40
42
-
Ref-struct holders need .NET 9 and C# 13 or later, and ref-struct and pointer signatures need unsafe blocks.
41
+
Ref-struct signatures need .NET 9 and C# 13 or later (`ST023`), and ref-struct and pointer signatures need unsafe blocks (`ST009`).
|`ST015`| Generic intercepted methods use runtime `MakeGenericMethod`| Use non-generic members with closed parameter and return types |
263
-
|`ST015`| Ref-struct interception needs by-ref-like generics | Target .NET 9 or later, with C# 13 or later |
264
263
|`ST015`|`IQueryable` defaults require dynamic code | Register an AOT-compatible typed `DefaultValueProvider` factory, or avoid `DefaultValueBehavior` for that member |
265
264
266
265
Generated stunts register typed constructors from a module initializer, so they are created
0 commit comments