Changeset 558 in dev for trunk/ab5.0/abdev/BasicCompiler_Common/src/Method.cpp
- Timestamp:
- May 5, 2008, 10:41:25 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/abdev/BasicCompiler_Common/src/Method.cpp
r523 r558 4 4 5 5 6 boolDynamicMethod::Override( const UserProc *pUserProc, Prototype::Accessibility accessibility, bool isOverrideModifier )6 DynamicMethod::OverrideResult::EnumType DynamicMethod::Override( const UserProc *pUserProc, Prototype::Accessibility accessibility, bool isOverrideModifier ) 7 7 { 8 if( this->IsVirtual() 9 && !this->IsAbstract() 10 && isOverrideModifier == false ) 11 { 12 // Override修飾子が無い状況で基底クラスの実体メソッドをオーバーライドしようとした 13 compiler.errorMessenger.Output(127,NULL,cp); 14 } 8 bool isAbstractBefore = this->IsAbstract(); 15 9 16 10 //メンバ関数を上書き … … 18 12 this->SetAbstractMark( false ); 19 13 20 if( !this->IsVirtual() )14 if( this->IsVirtual() ) 21 15 { 22 // オーバーライドミス 23 compiler.errorMessenger.Output(136, pUserProc->GetName(), cp); 16 if( !isAbstractBefore && isOverrideModifier == false ) 17 { 18 return OverrideResult::NotUseOverrideModifier; 19 } 24 20 } 25 if(this->GetAccessibility() != accessibility )21 else 26 22 { 27 compiler.errorMessenger.Output(128,NULL,cp);23 return OverrideResult::NotVirtual; 28 24 } 29 25 30 return true; 26 if( this->GetAccessibility() != accessibility ) 27 { 28 return OverrideResult::DifferentAccesibility; 29 } 30 31 return OverrideResult::Successful; 31 32 } 32 33 … … 71 72 } 72 73 73 CMethod *Methods::FindForOverride( const Types &actualTypeParametersForThisMethods, const UserProc *pUserProc )74 DynamicMethod *Methods::FindForOverride( const Types &actualTypeParametersForThisMethods, const UserProc *pUserProc ) 74 75 { 75 76 //メソッドのオーバーライド … … 79 80 if( !pMethod->IsNotUse() && pMethod->GetUserProc().IsEqualForOverride( actualTypeParametersForThisMethods, pUserProc ) ) 80 81 { 81 return pMethod;82 return dynamic_cast<DynamicMethod *>(pMethod); 82 83 } 83 84 }
Note:
See TracChangeset
for help on using the changeset viewer.