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
- Crash on physx::shdfnd::atomicIncrement when adjusting values on a character controller component after entering Play mode in Prefab edit mode
- [Rendering Debugger] [NewInputSystem] Debug Overlays in Play mode throws InvalidOperationException when using New Input System
- [RenderingDebugger][InputSystemPackage] Ctrl+Backspace shortcut doesn't work to open the Rendering Debugger when New Input System is in use
- No option to skip video transcoding when launching a Project
- “ValidateSchema Error2” error is thrown in the Player when using IL2CPP Scripting Backend
Resolution Note:
By design, however, we will improve the documentations to explain why this is happening. https://jira.unity3d.com/browse/DOCF-1192