Fix handling recursion over fields (#88083)
authorMichal Strehovský <MichalStrehovsky@users.noreply.github.com>
Wed, 28 Jun 2023 03:36:13 +0000 (12:36 +0900)
committerGitHub <noreply@github.com>
Wed, 28 Jun 2023 03:36:13 +0000 (12:36 +0900)
commit8ecddda29062273bb3d958a0018d41a5cc3f011a
treee82798cddb1749df5d4d9113044be7f57f95399e
parentb9bafbada05ff0edffb6523ba2706188e0f61801
Fix handling recursion over fields (#88083)

See the test for an example. C++ would probably tell the user to take a hike for a template like this, but we need to support this in .NET.

* Use the same logic to root types of reflectable fields as we do for methods instead of asking for a concrete type
* Fix another issue in debug info emission. We already had logic to cut off deep generics, but deep arrays weren't considered. Also consider array depth.
src/coreclr/tools/Common/Compiler/TypeExtensions.cs
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ReflectedFieldNode.cs
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ReflectionInvokeMapNode.cs
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/UserDefinedTypeDescriptor.cs
src/tests/nativeaot/SmokeTests/UnitTests/Generics.cs