Skip to content

Add more types to IntrinsicTypes#9954

Open
766974616c79 wants to merge 1 commit intoFacepunch:masterfrom
766974616c79:more-types-to-IntrinsicTypes
Open

Add more types to IntrinsicTypes#9954
766974616c79 wants to merge 1 commit intoFacepunch:masterfrom
766974616c79:more-types-to-IntrinsicTypes

Conversation

@766974616c79
Copy link
Contributor

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

  • Code follows existing style and conventions
  • No unnecessary formatting or unrelated changes
  • Public APIs are documented (if applicable)
  • Unit tests added where applicable and all passing
  • I’m okay with this PR being rejected or requested to change 🙂

Copilot AI review requested due to automatic review settings February 2, 2026 22:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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<>, and Task<> to the intrinsic types collection
  • Added necessary using System.Threading.Tasks directive

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +149 to +150
typeof(Action<>),
typeof(Func<>),
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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<,,,,,,,>),

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have considered this, and I am awaiting a response from fp, as some types can be very deep.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TypeLibrary] Action, Action<>, Func<>, Task<> types is not registered in TypeLibrary

1 participant