Index: trunk/abdev/BasicCompiler_Common/src/Class.cpp
===================================================================
--- trunk/abdev/BasicCompiler_Common/src/Class.cpp	(revision 349)
+++ trunk/abdev/BasicCompiler_Common/src/Class.cpp	(revision 350)
@@ -449,4 +449,29 @@
 	interfaces.push_back( new ::Interface( &interfaceClass ) );
 
+	// キャストメソッドを追加（内部コードは自動生成すること）
+	{
+		// Function Operator() As ITest
+
+		char temporary[1024];
+		sprintf(temporary,"%c%c%c%c()%c%c%s",
+			1, ESC_FUNCTION,
+			1, ESC_OPERATOR,
+			1, ESC_AS,
+			interfaceClass.GetName().c_str()
+		);
+
+		this->AddMethod(this,
+			Prototype::Public,
+			0,
+			false,			// isConst
+			false,			// isAbstract
+			false,			// isVirtual
+			false,			// isOverride
+			true,			// isAutoGeneration
+			temporary,
+			-1
+		);
+	}
+
 	return true;
 }
@@ -505,5 +530,5 @@
 
 void CClass::AddMethod(CClass *pobj_c, Prototype::Accessibility accessibility, BOOL bStatic, bool isConst, bool isAbstract,
-						 bool isVirtual, bool isOverride, char *buffer, int nowLine){
+						 bool isVirtual, bool isOverride, bool isAutoGeneration, char *buffer, int nowLine){
 	int i,i2;
 	char temporary[VN_SIZE];
@@ -522,4 +547,10 @@
 	UserProc *pUserProc = compiler.GetObjectModule().meta.GetUserProcs().Add( NamespaceScopes(), NamespaceScopesCollection(), buffer,nowLine,isVirtual,pobj_c, (bStatic!=0) );
 	if(!pUserProc) return;
+
+	if( isAutoGeneration )
+	{
+		// コード自動生成
+		pUserProc->ThisIsAutoGenerationProc();
+	}
 
 
@@ -665,5 +696,5 @@
 }
 
-void CClass::EnumDynamicMethodsOfInterfaceMethods( const char *methodName, std::vector<const UserProc *> &subs ) const
+void CClass::EnumDynamicMethodsOrInterfaceMethods( const char *methodName, std::vector<const UserProc *> &subs ) const
 {
 	// 動的メソッド
@@ -676,5 +707,5 @@
 	}
 }
-const CMethod *CClass::GetDynamicMethodOfInterfaceMethod( const UserProc *pUserProc ) const
+const CMethod *CClass::GetDynamicMethodOrInterfaceMethod( const UserProc *pUserProc ) const
 {
 	// 動的メソッド
@@ -687,4 +718,8 @@
 		{
 			result = pInterface->GetDynamicMethods().GetMethodPtr( pUserProc );
+			if( result )
+			{
+				return result;
+			}
 		}
 	}
@@ -854,4 +889,21 @@
 	SetError();
 	return;
+}
+int CClass::GetVtblMasterListIndex( const CClass *pClass ) const
+{
+	int result = 0;
+
+	BOOST_FOREACH( const ::Interface *pInterface, interfaces )
+	{
+		result++;
+		
+		if( &pInterface->GetClass() == pClass )
+		{
+			return result;
+		}
+	}
+
+	SetError();
+	return 0;
 }
 long CClass::GetVtblMasterListOffset() const
@@ -1428,9 +1480,10 @@
 				pobj_c->AddMethod(pobj_c,
 					Prototype::Public,	//Publicアクセス権
-					0,					//Static指定なし
-					false,				//Constではない
-					1,					//Abstract
-					1,					//Virtual
-					0,
+					0,					// bStatic
+					false,				// isConst
+					true,				// isAbstract
+					true,				// isVirtual
+					false,				// isOverride
+					false,				// isAutoGeneration
 					temporary,
 					sub_address
@@ -1719,4 +1772,5 @@
 						isVirtual,
 						isOverride,
+						false,
 						temporary,
 						sub_address);
@@ -1946,5 +2000,5 @@
 		}
 
-		pCompilingMethod = pParentClass->GetDynamicMethodOfInterfaceMethod( pUserProc );
+		pCompilingMethod = pParentClass->GetDynamicMethodOrInterfaceMethod( pUserProc );
 		if( !pCompilingMethod ){
 			pCompilingMethod = pParentClass->GetStaticMethods().GetMethodPtr( pUserProc );
Index: trunk/abdev/BasicCompiler_Common/src/Procedure.cpp
===================================================================
--- trunk/abdev/BasicCompiler_Common/src/Procedure.cpp	(revision 349)
+++ trunk/abdev/BasicCompiler_Common/src/Procedure.cpp	(revision 350)
@@ -24,4 +24,12 @@
 
 	return GetName();
+}
+bool UserProc::IsCastOperator() const
+{
+	if( GetName()[0] == 1 && GetName()[1] == ESC_OPERATOR && GetName()[2] == CALC_AS )
+	{
+		return true;
+	}
+	return false;
 }
 const NamespaceScopes &UserProc::GetNamespaceScopes() const
Index: trunk/abdev/BasicCompiler_Common/src/Type.cpp
===================================================================
--- trunk/abdev/BasicCompiler_Common/src/Type.cpp	(revision 349)
+++ trunk/abdev/BasicCompiler_Common/src/Type.cpp	(revision 350)
@@ -211,8 +211,4 @@
 	if( IsObject() )
 	{
-		if( GetClass().IsInterface() ){
-			// vtblOffsetのサイズを含める
-			return PTR_SIZE*2;
-		}
 		return PTR_SIZE;
 	}
@@ -298,4 +294,9 @@
 bool Type::IsPointer( int basicType )
 {
+	if( basicType == DEF_NON )
+	{
+		return false;
+	}
+
 	if(PTR_LEVEL( basicType )|| basicType == DEF_PTR_VOID || basicType == DEF_PTR_PROC
 		|| ( basicType & FLAG_PTR ) ){
@@ -448,4 +449,9 @@
 	return ( IsObject() && GetClass().IsDelegate() );
 }
+bool Type::IsInterface() const
+{
+	return ( IsObject() && GetClass().IsInterface() );
+}
+
 
 bool Type::HasMember() const
