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
Maybe this isn't possible (and I haven't dug in) but is it possible to make type.Name/type.FullName work with reflection free mode (which I know is basically impossible to make certain workloads work). There are a bunch of scenarios where knowing the type name is important (not just for logging) but for error messages etc.
If that wasn't possible the other crazy idea I had was to support it only for generic methods:
For that to be feasible, we should ideally get rid of System.Private.DisabledReflection and replace it with the real reflection stack where we disable certain codepaths using the .NET 5 feature switches. I don't want to replicate metadata parsing and resolution in System.Private.DisabledReflection.
typeof(T).ToString() is weird but works and that is really a blessing. If you controlls the code you could manual and maintainable (contradictious?) code which combines typeof(T).ToString() with nameof(class) and static code.
Maybe this isn't possible (and I haven't dug in) but is it possible to make type.Name/type.FullName work with reflection free mode (which I know is basically impossible to make certain workloads work). There are a bunch of scenarios where knowing the type name is important (not just for logging) but for error messages etc.
If that wasn't possible the other crazy idea I had was to support it only for generic methods:
The AOT compiler could replace this with a constant generated at compile time.
The text was updated successfully, but these errors were encountered: