Search Issue Tracker
Fixed in 2023.1.X
Fixed in 2020.3.X, 2021.3.X, 2022.1.X
Votes
0
Found in
2020.3
2021.3
2021.3.0f1
2022.1
2022.2
Issue ID
1422119
Regression
Yes
[IL2CPP] Assembly.GetType returns a nested Class when the nested Class is defined before the non-nested one
Reproduction steps:
1. Open the attached project "Case_1422119.zip" and load Scene "Assembly.GetType"
2. Ensure IL2CPP is selected as the Scripting Backend in Project Settings and "Development Build" is checked in Build Settings
3. Build and Run the Project
4. Observe the errors thrown in the Build
Expected result: The following errors are thrown:
"ClassA found in Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null: ClassA."
"ClassB not found in Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null."
Actual result: The following errors are thrown:
"ClassA found in Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null: ClassParent+ClassA."
"ClassB found in Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null: ClassParent+ClassB."
Reproducible with: 2020.2.0a18, 2020.3.35f1, 2021.3.3f1, 2022.1.1f1, 2022.2.0a14
Not reproducible with: 2019.4.39f1, 2020.1.17f1
Could not test with: 2020.2.0a1 - 2020.2.0a17 (Building the project fails)
Notes:
- The project contains 2 definitions of ClassA: one is nested inside the ClassParent and one is defined outside of it. ClassB is nested inside ClassParent as well
- The ClassA found by GetType is the one that is defined first (in this case, ClassParent is defined before ClassA, thus the ClassA nested inside ClassParent is the one that is found)
- Not reproducible in Editor, Mono Builds, and C# Console Application
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- PlayerPrefs get corrupted when a minimized fullscreen Player is closed through the Taskbar
- "To Debug, run app with -diag-job-temp-memory-leak-validation cmd line argument. This will output the callstacks of the leaked allocations." warning is printed when JobTempMemoryLeakValidation switch is enabled
- Main Thread stalling when loading Audio Source asset asynchronously while preloading another Audio Source asset
- Material artifacts occur in the Material Preview window when baked lighting is applied to scenes
- “ArgumentOutOfRangeException” after saving, reseting and re-add Default Tile Palette Tools to the list in Preferences window
Resolution Note (fix version 2023.1):
Fixed in 2023.1.0a1
Resolution Note (fix version 2022.1):
Fixed in 2022.1.8f1
Resolution Note (fix version 2021.3):
Fixed in 2021.3.7f1
Resolution Note (fix version 2020.3):
Fixed in 2020.3.38f1