title: New VB.NET function signature behavior in Visual Studio 2012/2013
body: <p>I found some interesting behavior with how VB.NET handles function signatures.  This new behavior started in VS2012 and continues to persist in VS2013.</p>
  
  <p>Consider the following code segment:</p>
  
  <pre><code>Class test
      Function a(x As String, Optional y As Boolean = False) As String
          Return "function a() was called"
      End Function
  
      Function a(x As String) As String
          Return "second function a() was called"
      End Function
  End Class
  </code></pre>
  
  <p>My first thought is that this will not compile, which is true in VS2010 and earlier versions.  However, VS2012 and VS2013 compiles the code without even a warning.  If you then run the following:</p>
  
  <pre><code>Dim x As New test()
  MsgBox(x.a("123"))
  </code></pre>
  
  <p>The message indicates that the function without the optional parameter is called.</p>
  
  <p>Is there a way to turn this behavior off?  It would seem that this could open the door to a developer unknowingly adding functions with the same name as other functions that have optional parameters, causing undesirable redirects.</p>