title: Swift - Overriding functions with different default parameters
body: <p>Case: A base class (A) with a function (doSomething) that has a default parameter (param: T = foo), and a subclass (B) which overrides that function with a different default parameter (param: T = bar). <strong>But is then called as A.</strong></p>
  
  <p>Edit: Apologies for the original code, so actually what is happening is basically the following:</p>
  
  <pre><code>class Foo
  {
      func doSomething(a: String = "123")
      {
          print(a)
      }
  }
  
  class Bar: Foo
  {
      override func doSomething(a: String = "abc")
      {
          print("Using Bar method body... but not Bar's default a value!")
          print(a)
      }
  }
  
  (Bar() as Foo).doSomething()
  
  // Prints:
  // Using Bar method body... but not Bar's default a value!
  // 123
  </code></pre>
  
  <p>Is it a bug or expected behaviour that it uses the functions body but doesn't use the functions default parameter?</p>