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
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
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