Ignore:
Timestamp:
Jan 2, 2008, 12:50:34 AM (16 years ago)
Author:
dai_9181
Message:

ジェネリクスインターフェイス実装時のオーバーロード解決ロジックを改良。(型パラメータを戻り値に持つメソッドのオーバーロードをミスしてしまうバグを修正)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abdev/BasicCompiler_Common/src/Procedure.cpp

    r364 r382  
    1616#endif
    1717
     18
     19bool UserProc::IsEqualForOverride( const Types &actualTypeParametersForThisProc, const UserProc *pUserProc ) const
     20{
     21    if( this->GetName() == pUserProc->GetName()                     // 名前空間及び名前が等しい
     22        && this->Params().Equals( pUserProc->Params() ) )           // パラメータが等しい
     23    {
     24        if( this->returnType.Equals( pUserProc->returnType ) )
     25        {
     26            // 戻り値が等しい
     27            return true;
     28        }
     29
     30        if( this->returnType.IsTypeParameter() )
     31        {
     32            // 型パラメータだったとき
     33            if( actualTypeParametersForThisProc[this->returnType.GetFormalTypeIndex()].Equals( pUserProc->returnType ) )
     34            {
     35                // 戻り値が等しい
     36                return true;
     37            }
     38        }
     39    }
     40    return false;
     41}
     42   
    1843
    1944std::string UserProc::GetFullName() const
Note: See TracChangeset for help on using the changeset viewer.