#include "stdafx.h" #include void Delegate::RefleshParameterAndReturnType() { compiler.GetNamespaceSupporter().SetImportedNamespaces( this->importedNamespaces ); compiler.GetNamespaceSupporter().SetLivingNamespaceScopes( this->GetNamespaceScopes() ); // パラメータを解析 Jenga::Common::Strings parameterStrings; SplitParameter( paramStr, parameterStrings ); ActiveBasic::Compiler::LexicalAnalyzer::AnalyzeParameter( params, parameterStrings, sourceIndex ); // 動的パラメータを作る dynamicParams = params; dynamicParams.insert( dynamicParams.begin(), new Parameter( "_System_LocalThis", Type( DEF_PTR_VOID ) ) ); if( IsFunction() ) { // 戻り値を取得 if( !compiler.StringToType( returnTypeName, returnType ) ) { compiler.errorMessenger.Output(3,returnTypeName,sourceIndex); } } } bool Delegate::IsSimilar( const Delegate &dgt ) const { if( this->Params().Equals( dgt.Params(), true ) ) // パラメータが等しい、もしくは反変 { if( this->returnType.Equals( dgt.returnType ) ) { // 戻り値が等しい return true; } else if( this->returnType.IsCovariant( dgt.returnType ) ) { // 戻り値が共変 return true; } } return false; }