Search Issue Tracker
By Design
By Design in 2022.2.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
- Font character thickness does not adjust properly in UI Toolkit text when changing Bold Weight in Font Asset
- Multiple "[...] is inaccessible due to its protection level" errors are thrown when opening project with Unity Version Control installed
- Font character thickness does not adjust properly in UI Toolkit text when changing Bold Weight in Font Asset
- Sorting icons are tiny and misaligned in Import Activity window
- The Undo system does not record HideFlags.HideInHierarchy changes
Resolution Note:
By design, however, we will improve the documentations to explain why this is happening. https://jira.unity3d.com/browse/DOCF-1192
Resolution Note (2022.2.X):
By design, however, we will improve the documentations to explain why this is happening. https://jira.unity3d.com/browse/DOCF-1192