Search Issue Tracker
Postponed means that the issue was either a feature request or something that requires major refactoring on our side. Since that makes the issue not actionable in the close future we choose to close it as Postponed and add it on our internal roadmaps and technical debt pages instead.
Postponed
Votes
0
Found in
5.3.5f1
Issue ID
807536
Regression
No
Function overloading with and optional arguments
An odd C# behaviour in our editor.
Steps to reproduce:
- Create two functions in a file like:
private void TestFunc(object value, Action action = null)
and
private void TestFunc(object[] value, Action action = null)
- Unity logs the error:
Assets/TestScript.cs(18,10): error CS0121: The call is ambiguous between the following methods or properties: 'TestScript.TestFunc(object, System.Action)' and 'TestScript.TestFunc(object[], System.Action)'
- When getting rid of the default valued paratemers, it doesn't show the error. Example"
private void TestFunc(object value)
and
private void TestFunc(object[] value)
Tested on Unity 5.3.5f1, 5.4.0b24, and 5.2.5f1; using Monodevelop 5.9.6 on Mac.
This is valid C# code.
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 when D3D12RenderPass::SetupDeviceResources when opening FBX animation preview
- Serialization errors are thrown when "com.unity.render-pipelines.core" is added as a custom package and Graphics window is opened
- Character Joints unexpectedly rotate when a ragdoll is created using the Ragdoll Wizard
- Crash on GfxDeviceD3D11Base::DrawBuffersBatchMode when rendering the Scene view
- The shared EditorBuildSettings.asset file of symlinked projects is not updated when changing the order of the Scenes in Build Settings in one of the projects
Add comment