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
- UI Overlay Image gets darker on each Camera when multiple Cameras are used
- Assertion failed on expression: 'scriptedImporterClass == SCRIPTING_NULL error when opening the standalone profiler window
- Disabled assets in Import Unity Package window aren't tracked but count as being selected by user
- [Windows] Crash on GetManagerFromContext when video is playing and creating High Definition 3D Projects after FMOD failed to switch back to normal output Error appeared
- GC Alloc produced when adding items to MultiColumnListView with Auto Assign Binding
Add comment