Index: trunk/ab5.0/abdev/BasicCompiler_Common/src/Compiler.cpp
===================================================================
--- trunk/ab5.0/abdev/BasicCompiler_Common/src/Compiler.cpp	(revision 603)
+++ trunk/ab5.0/abdev/BasicCompiler_Common/src/Compiler.cpp	(revision 628)
@@ -14,5 +14,6 @@
 }
 
-bool Compiler::StringToType( const std::string &typeName, Type &type ){
+ActiveBasic::Compiler::Error::StringToTypeErrorCode::EnumType Compiler::StringToTypeEx( const std::string &typeName, Type &type, bool isResolveGenerics )
+{
 	type.SetIndex( -1 );
 
@@ -35,5 +36,5 @@
 		if( !pGenericClass )
 		{
-			return false;
+			return ActiveBasic::Compiler::Error::StringToTypeErrorCode::NotfoundGenericClass;
 		}
 
@@ -70,5 +71,5 @@
 		type.SetActualGenericTypes( genericTypes );
 
-		return true;
+		return ActiveBasic::Compiler::Error::StringToTypeErrorCode::Successful;
 	}
 
@@ -102,37 +103,42 @@
 			type.SetBasicType( DEF_PTR_PROC );
 			type.SetIndex( this->GetObjectModule().meta.GetProcPointers().size() - 1 );
-			return true;
+			return ActiveBasic::Compiler::Error::StringToTypeErrorCode::Successful;
 		}
 
 		const std::string &nextTypeName = typeName.substr( 1 );
 
-		if( !StringToType( nextTypeName, type ) ){
-			return false;
+		ActiveBasic::Compiler::Error::StringToTypeErrorCode::EnumType result = StringToTypeEx( nextTypeName, type, isResolveGenerics );
+		if( result != ActiveBasic::Compiler::Error::StringToTypeErrorCode::Successful )
+		{
+			return result;
 		}
 
 		type.PtrLevelUp();
 
-		return true;
+		return ActiveBasic::Compiler::Error::StringToTypeErrorCode::Successful;
 	}
 
 	{
 		int basicType;
-		if( Type::StringToBasicType( typeName, basicType ) ){
+		if( Type::StringToBasicType( typeName, basicType ) )
+		{
 			// 基本型だったとき
 			type.SetBasicType( basicType );
-			return true;
+			return ActiveBasic::Compiler::Error::StringToTypeErrorCode::Successful;
 		}
 	}
 
 	// Object型だったとき
-	if( typeName == "Object" ){
+	if( typeName == "Object" )
+	{
 		type.SetType( DEF_OBJECT, this->GetObjectModule().meta.GetClasses().GetObjectClassPtr() );
-		return true;
+		return ActiveBasic::Compiler::Error::StringToTypeErrorCode::Successful;
 	}
 
 	// String型だったとき
-	if( typeName == "String" ){
+	if( typeName == "String" )
+	{
 		type.SetType( DEF_OBJECT, this->GetObjectModule().meta.GetClasses().GetStringClassPtr() );
-		return true;
+		return ActiveBasic::Compiler::Error::StringToTypeErrorCode::Successful;
 	}
 
@@ -142,20 +148,34 @@
 	////////////////////
 	int i=this->GetObjectModule().meta.GetTypeDefs().GetIndex( LexicalAnalyzer::FullNameToSymbol( typeName ) );
-	if(i!=-1){
+	if(i!=-1)
+	{
 		type = this->GetObjectModule().meta.GetTypeDefs()[i].GetBaseType();
-		return true;
+		return ActiveBasic::Compiler::Error::StringToTypeErrorCode::Successful;
 	}
 
 	//クラス
 	const CClass *pobj_c = this->GetObjectModule().meta.GetClasses().FindEx( LexicalAnalyzer::FullNameToSymbol( typeName ) );
-	if(pobj_c){
-		if( pobj_c->IsStructure() ){
+	if(pobj_c)
+	{
+		if( isResolveGenerics )
+		{
+			if( pobj_c->IsGeneric() )
+			{
+				// ジェネリッククラスの場合
+				trace( "型解決されていない" );
+				return ActiveBasic::Compiler::Error::StringToTypeErrorCode::FailedResolveGenericType;
+			}
+		}
+
+		if( pobj_c->IsStructure() )
+		{
 			type.SetBasicType( DEF_STRUCT );
 		}
-		else{
+		else
+		{
 			type.SetBasicType( DEF_OBJECT );
 		}
 		type.SetClassPtr( pobj_c );
-		return true;
+		return ActiveBasic::Compiler::Error::StringToTypeErrorCode::Successful;
 	}
 
@@ -176,5 +196,5 @@
 			type.SetFormalTypeName( typeName );
 			type.SetFormalTypeIndex( formalTypeIndex );
-			return true;
+			return ActiveBasic::Compiler::Error::StringToTypeErrorCode::Successful;
 		}
 	}
@@ -183,5 +203,10 @@
 	/////////////////////////////////////////////////////////
 
-	return false;
+	return ActiveBasic::Compiler::Error::StringToTypeErrorCode::NotfoundType;
+}
+
+bool Compiler::StringToType( const std::string &typeName, Type &type )
+{
+	return ( StringToTypeEx( typeName, type, false ) == ActiveBasic::Compiler::Error::StringToTypeErrorCode::Successful );
 }
 
