title: Swift function not accepting variable
body: <p>The code is written in Swift 2.0. I am doing a little tinkering project for clash of clans. My code is below. </p>
  
  <pre><code>enum Resource {
      case gold
      case elixer
      case darkElixer
  }
  
  class Avatar {
      var cost, health, damage, space: Int
      var costType: Resource
      init(damage: Int, health: Int, cost: Int, costType: Resource, space: Int){
          self.damage = damage
          self.health = health
          self.cost = cost
          self.costType = costType
          self.space = space
      }
  }
  
  class Barbarian: Avatar {
      init() {
          super.init(damage: 44, health: 110, cost: 200, costType: .elixer, space: 1)
      }
  }
  
  class Archer: Avatar {
      init() {
          super.init(damage: 22, health: 44, cost: 400, costType: .elixer, space: 1)
      }
  }
  </code></pre>
  
  <p>I am trying this function.</p>
  
  <pre><code>func troopCost(troop: Avatar, quantity: Int) -&gt; (Int, Resource){
      let rResource = troop.costType
      let rCost = troop.cost * quantity
      return (rCost, rResource)
  }
  </code></pre>
  
  <p>When I call the function like this.</p>
  
  <pre><code>troopCost(Barbarian, quantity: 2)
  </code></pre>
  
  <p>I get this error.</p>
  
  <pre><code>Cannon invoke 'troopCost' with an argument list of type '(Barbarian.Type, quantity: Int)'
  </code></pre>