Changeset 382 in dev for trunk/abdev/BasicCompiler_Common/src
- Timestamp:
- Jan 2, 2008, 12:50:34 AM (17 years ago)
- Location:
- trunk/abdev/BasicCompiler_Common/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler_Common/src/Class.cpp
r380 r382 340 340 BOOST_FOREACH( CMethod *pMethod, GetDynamicMethods() ) 341 341 { 342 CMethod *pMethodForOverride = pDestInterface->GetDynamicMethods().FindForOverride( &pMethod->GetUserProc() );342 CMethod *pMethodForOverride = pDestInterface->GetDynamicMethods().FindForOverride( pDestInterface->GetActualTypeParameters(), &pMethod->GetUserProc() ); 343 343 if( pMethodForOverride ) 344 344 { … … 524 524 if( pMethod->GetInheritsClassPtr() ) continue; 525 525 526 if( pMethod->GetUserProc().IsEqualForOverride( p UserProc ) )526 if( pMethod->GetUserProc().IsEqualForOverride( pobj_c->GetSuperClassActualTypeParameters(), pUserProc ) ) 527 527 { 528 528 //関数名、パラメータ、戻り値が合致したとき … … 536 536 537 537 // メソッドのオーバーライド 538 CMethod *pMethodForOverride = pobj_c->GetDynamicMethods().FindForOverride( p UserProc );538 CMethod *pMethodForOverride = pobj_c->GetDynamicMethods().FindForOverride( pobj_c->GetSuperClassActualTypeParameters(), pUserProc ); 539 539 if( pMethodForOverride ) 540 540 { … … 545 545 else 546 546 { 547 548 if( pUserProc->GetName() == "GenericProc" ) 549 { 550 int test=0; 551 } 552 547 553 // インターフェイス メソッドのオーバーライド 548 554 BOOST_FOREACH( ::Interface *pInterface, pobj_c->GetInterfaces() ) … … 562 568 } 563 569 564 CMethod *pMethodForOverride = pInterface->GetDynamicMethods().FindForOverride( p UserProc );570 CMethod *pMethodForOverride = pInterface->GetDynamicMethods().FindForOverride( pInterface->GetActualTypeParameters(), pUserProc ); 565 571 if( pMethodForOverride ) 566 572 { -
trunk/abdev/BasicCompiler_Common/src/Method.cpp
r370 r382 71 71 } 72 72 73 CMethod *Methods::FindForOverride( const UserProc *pUserProc )73 CMethod *Methods::FindForOverride( const Types &actualTypeParametersForThisMethods, const UserProc *pUserProc ) 74 74 { 75 75 //メソッドのオーバーライド … … 77 77 BOOST_FOREACH( CMethod *pMethod, methods ) 78 78 { 79 if( !pMethod->IsNotUse() && pMethod->GetUserProc().IsEqualForOverride( pUserProc ) )79 if( !pMethod->IsNotUse() && pMethod->GetUserProc().IsEqualForOverride( actualTypeParametersForThisMethods, pUserProc ) ) 80 80 { 81 81 return pMethod; -
trunk/abdev/BasicCompiler_Common/src/Procedure.cpp
r364 r382 16 16 #endif 17 17 18 19 bool 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 18 43 19 44 std::string UserProc::GetFullName() const
Note:
See TracChangeset
for help on using the changeset viewer.