Search Issue Tracker
By Design
Votes
0
Found in
2022.2.0a13
Issue ID
UUM-3565
Regression
No
Roslyn Source Generator generates a class multiple times
Reproduction steps:
1. Open the attached 'Roslyn Code Gen Test' project
2. Add the 'TestCodeGen.dll' to the project
3. Observe the 'TestCodeGen.dll' in the Inspector
4. Add the 'RoslynAnalyzer' Asset Label to the 'TestCodeGen.dll'
5. Wait for the script compilation to complete
Expected result: No warnings are in the Console
Actual result: Warning CS0436 appears in the Console
Reproducible with: 2021.3.1f1, 2022.1.0b16, 2022.2.0a13
Could not test with: 2019.4.38f1, 2020.3.34f1 (Assembly 'Assets/TestCodeGen.dll' will not be loaded due to errors)
Full warning:
Assets/HelloFromSourceGenerator.cs(10,16): warning CS0436: The type 'ExampleSourceGenerated' in 'TestCodeGen/ExampleSourceGenerator.ExampleSourceGenerator/exampleSourceGenerator.cs' conflicts with the imported type 'ExampleSourceGenerated' in 'Unity.PlasticSCM.Editor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'TestCodeGen/ExampleSourceGenerator.ExampleSourceGenerator/exampleSourceGenerator.cs'.
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
- Fields are not focused correctly when using UI Builder
- UNITY_SERVER scripting define does not work when switching to Dedicated Server from Windows by script
- Mesh.CombineMeshes discards empty sub-meshes when 'mergeSubmeshes' is set to false
- [Linux] MacOS build fails for every architecture when the project contains a "StreamingAssets" folder with empty an "yaml" file
- Property drawers do not always update height correctly when expanded via iteration
Resolution Note:
By design, however, we will improve the documentations to explain why this is happening. https://jira.unity3d.com/browse/DOCF-1192