Search Issue Tracker
By Design
Votes
0
Found in
2020.2
2020.3
2021.1
2021.1.2f1
2021.2
Issue ID
1340699
Regression
No
The 'Class can not exist in multiple namespaces in the same file' warning should be displayed as an error
How to reproduce:
1. Open the user's attached project
2. In the Project window right-click on the 'NotOk' Script and select 'Reimport'
3. Observe the Console
Expected result: The 'Class NotOk can not exist in multiple namespaces in the same file..' error appears in the Console
Actual result: The 'Class NotOk can not exist in multiple namespaces in the same file..' warning appears in the Console
Reproducible with: 2020.2.7f1, 2020.3.12f1, 2021.1.11f1, 2021.2.0a19
Cannot test with: 2018.4.35f1, 2019.4.28f1 (the warning is not shown)
Note:
- Full warning message:
Class NotOk can not exist in multiple namespaces in the same file, even if one is excluded with preprocessor directives. Please move these to separate files if this is the case.
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
- “[Worker0] Could not generate preview image“ error when opening macOS native plugin in the Inspector with Architecture to build for set to ARM 64-bit
- [iOS] Application.absoluteURL is empty on Awake/Start when opening via deep link with Splash Screen disabled
- Crash on MemoryManager::Deallocate when rapidly calling Addressables.LoadAssetAsync
- 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
Resolution Note:
This should remain a warning as it is only an issue if the component is manipulated in the editor (e.g.: added to a scene or prefab via the editor).
If the component is only used via code dynamically, it does not cause any problem.
We wont treat it as an error as it can break valid scenarios and would introduce a breaking change.