-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ILC error when using a function pointer type nested under a generic type #81117
Comments
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas Issue DetailsAlthough a function pointer type can't be a generic type parameter, it can be an element type of an array, which the array type can then be a generic type parameter. Doing that causes a publish error (works on CoreClr and Mono at runtime). Attempting to public this: Console.WriteLine("Before");
Type t = typeof(Tuple<delegate*<void>[]>);
Console.WriteLine("Success");
Console.WriteLine(t); results in:
See this for more detail:
|
@MichalStrehovsky this still occurs for |
I can't repro that. Do you have the latest main? Is the stack the same? I could believe you can hit it with a different stack - when C# added function pointers, we did enough work to make things not crash, but since the runtime behaviors were undefined, we just whack everything to IntPtr and it's possible there's another place that doesn't whack it. |
I did sync to main after your change. Here was the last error in CI (tests since then have been commented out):
The commented out areas are here: https://github.com/dotnet/runtime/pull/81006/files#diff-bb1e2397e5ebf8ae1c225d15c3155863faf5091de2a3c0f74e47c4f5e280a57b
|
Yep, this was from a different spot than typeof. Hopefully #81344 will address all the remaining issues. |
Although a function pointer type can't be a generic type parameter, it can be an element type of an array, which the array type can then be a generic type parameter. Doing that causes a publish error (works on CoreClr and Mono at runtime).
Attempting to public this:
results in:
See this for more detail:
https://github.com/dotnet/runtime/pull/81006/files/f76c75dff31537a28208060c734dee688265039e#r1085734728
UPDATE: after additional test failures, there is a simpler repo:
typeof(delegate*<void>[]);
The text was updated successfully, but these errors were encountered: