Add more types to IntrinsicTypes#9954
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds several commonly used generic types to the IntrinsicTypes collection in the TypeLibrary, addressing issue #1099. The change enables these types to be recognized as intrinsic types within the Sandbox reflection system.
Changes:
- Added
Action,Action<>,Func<>, andTask<>to the intrinsic types collection - Added necessary
using System.Threading.Tasksdirective
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| typeof(Action<>), | ||
| typeof(Func<>), |
There was a problem hiding this comment.
The pattern established by ValueTuple types shows that multiple generic arities should be included. Consider adding overloads with more type parameters (e.g., Action<,>, Action<,,>, Func<,>, Func<,,>, etc.) to match the completeness of the ValueTuple entries above. Without these, generic delegates with multiple parameters won't be recognized as intrinsic types.
| typeof(Action<>), | |
| typeof(Func<>), | |
| typeof(Action<>), | |
| typeof(Action<,>), | |
| typeof(Action<,,>), | |
| typeof(Action<,,,>), | |
| typeof(Action<,,,,>), | |
| typeof(Action<,,,,,>), | |
| typeof(Action<,,,,,,>), | |
| typeof(Action<,,,,,,,>), | |
| typeof(Func<>), | |
| typeof(Func<,>), | |
| typeof(Func<,,>), | |
| typeof(Func<,,,>), | |
| typeof(Func<,,,,>), | |
| typeof(Func<,,,,,>), | |
| typeof(Func<,,,,,,>), | |
| typeof(Func<,,,,,,,>), |
There was a problem hiding this comment.
I have considered this, and I am awaiting a response from fp, as some types can be very deep.
Summary
Just adding values to a hashset. I just added the types requested in the issue. Let me know if I need to add more depth in generic types. (mean T1, T2, etc)
Motivation & Context
Fixes: #1099
Checklist