Search Issue Tracker
By Design
Unknown (hidden) 2023.1.X
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
- ScrollView speed is slower when entering Play mode
- UI Builder elements disappear and "Semantic - Unknown template name" error appears when changes to "Template" parameter are saved
- Renderers outside Light Probe hull use incorrect Ambient Probe values when "Renderer Light Probe Selection" is set to "Use Ambient Probe" and "Light Probes" on Mesh is set to "Blend Probes"
- ArgumentNullException error occurs when selecting a Camera in the Hierarchy with the Scene view open
- Clicking 'Open Editor Log' through the Console fails to open redirected Logs when relative Log files exist outside of the Project root
Resolution Note:
By design, however, we will improve the documentations to explain why this is happening. https://jira.unity3d.com/browse/DOCF-1192