title: c++ C2440 error cannot convert from 'const BWAPI::UpgradeType' to 'const BWAPI::Type *'
body: <p>error C2440: '=' : cannot convert from 'const BWAPI::UpgradeType' to 'const BWAPI::Type *'</p>
  
  <p>at this line </p>
  
  <pre><code>this-&gt;generalType = type;   
  </code></pre>
  
  <p>what is the problem? since UnitType extends Type shouldn't be permitted?</p>
  
  <pre><code>class CombatEvent {
  
  public:
      CombatEvent&amp; setUnitType(const UnitType&amp; type);
      const Type* getGeneralType() const;
  
  private:
      UnitType unitType;
      const Type* generalType;
  }
  
  // implementation
  
  CombatEvent&amp; CombatEvent::setUnitType(const UnitType&amp; type) {
  
      this-&gt;generalType = type;
      this-&gt;unitType = type;
  
      return *this;
   }
  </code></pre>