Index: BasicCompiler_Common/Class.cpp
===================================================================
--- BasicCompiler_Common/Class.cpp	(revision 108)
+++ BasicCompiler_Common/Class.cpp	(revision 114)
@@ -9,6 +9,6 @@
 CDBClass *pobj_DBClass;
 
-CClass *pobj_CompilingClass;
-CClass *pobj_StringClass;
+const CClass *pobj_CompilingClass;
+const CClass *pobj_StringClass;
 
 CMember *pCompilingMethod;
@@ -224,5 +224,6 @@
 	return isUsing;
 }
-void CClass::Using(){
+void CClass::Using() const
+{
 	isUsing = true;
 }
@@ -249,5 +250,5 @@
 }
 
-bool CClass::Inherits( CClass &inheritsClass, int nowLine ){
+bool CClass::Inherits( const CClass &inheritsClass, int nowLine ){
 
 	//ループ継承でないかをチェック
@@ -309,5 +310,5 @@
 	return true;
 }
-bool CClass::InheritsInterface( CClass &inheritsInterface, int nowLine ){
+bool CClass::InheritsInterface( const CClass &inheritsInterface, int nowLine ){
 
 	//ループ継承でないかをチェック
@@ -615,5 +616,6 @@
 	return n;
 }
-LONG_PTR CClass::GetVtblGlobalOffset(void){
+LONG_PTR CClass::GetVtblGlobalOffset(void) const
+{
 
 	//既に存在する場合はそれを返す
@@ -688,10 +690,12 @@
 
 // コンストラクタのコンパイルを開始
-void CClass::NotifyStartConstructorCompile(){
+void CClass::NotifyStartConstructorCompile() const
+{
 	isCompilingConstructor = true;
 }
 
 //コンストラクタのコンパイルを終了
-void CClass::NotifyFinishConstructorCompile(){
+void CClass::NotifyFinishConstructorCompile() const
+{
 	isCompilingConstructor = false;
 }
@@ -704,10 +708,10 @@
 
 //デストラクタのコンパイルを開始
-void CClass::NotifyStartDestructorCompile(){
+void CClass::NotifyStartDestructorCompile() const{
 	isCompilingDestructor = true;
 }
 
 //デストラクタのコンパイルを終了
-void CClass::NotifyFinishDestructorCompile(){
+void CClass::NotifyFinishDestructorCompile() const{
 	isCompilingDestructor = false;
 }
@@ -810,29 +814,5 @@
 }
 
-CClass *CDBClass::Find( const string &fullName ) const
-{
-	char AreaName[VN_SIZE] = "";		//オブジェクト変数
-	char NestName[VN_SIZE] = "";		//入れ子メンバ
-	bool isNest = SplitMemberName( fullName.c_str(), AreaName, NestName );
-
-	int key;
-	key=hash(NestName);
-
-	if(pobj_ClassHash[key]){
-		CClass *pobj_c;
-		pobj_c=pobj_ClassHash[key];
-		while(1){
-			if( pobj_c->IsEqualSymbol( fullName ) ){
-				//名前空間とクラス名が一致した
-				return pobj_c;
-			}
-
-			if(pobj_c->pobj_NextClass==0) break;
-			pobj_c=pobj_c->pobj_NextClass;
-		}
-	}
-	return NULL;
-}
-CClass *CDBClass::Find( const NamespaceScopes &namespaceScopes, const string &name ) const
+const CClass *CDBClass::Find( const NamespaceScopes &namespaceScopes, const string &name ) const
 {
 	int key;
@@ -852,5 +832,23 @@
 		}
 	}
+
+	// TypeDefも見る
+	int index = Smoothie::Meta::typeDefs.GetIndex( namespaceScopes, name );
+	if( index != -1 ){
+		Type type = Smoothie::Meta::typeDefs[index].GetBaseType();
+		if( type.IsObject() ){
+			return &type.GetClass();
+		}
+	}
+
 	return NULL;
+}
+const CClass *CDBClass::Find( const string &fullName ) const
+{
+	char AreaName[VN_SIZE] = "";		//オブジェクト変数
+	char NestName[VN_SIZE] = "";		//入れ子メンバ
+	bool isNest = SplitMemberName( fullName.c_str(), AreaName, NestName );
+
+	return Find( NamespaceScopes( AreaName ), NestName );
 }
 
@@ -1213,5 +1211,5 @@
 			GetIdentifierToken( temporary, basbuf, i );
 
-			CClass *pobj_c=pobj_DBClass->Find(namespaceScopes, temporary);
+			CClass *pobj_c = const_cast<CClass *>( pobj_DBClass->Find(namespaceScopes, temporary) );
 			if(!pobj_c) continue;
 
@@ -1251,5 +1249,5 @@
 
 				//継承元クラスを取得
-				CClass *pInheritsClass = Find(temporary);
+				const CClass *pInheritsClass = Find(temporary);
 				if( !pInheritsClass ){
 					SetError(106,temporary,i);
@@ -1359,5 +1357,5 @@
 			GetIdentifierToken( temporary, basbuf, i );
 
-			CClass *pobj_c=pobj_DBClass->Find(namespaceScopes, temporary);
+			CClass *pobj_c =  const_cast<CClass *>( pobj_DBClass->Find(namespaceScopes, temporary) );
 			if(!pobj_c) continue;
 
@@ -1416,5 +1414,5 @@
 
 				//継承元クラスを取得
-				CClass *pInheritsClass = Find(temporary);
+				const CClass *pInheritsClass = Find(temporary);
 				if( !pInheritsClass ){
 					SetError(106,temporary,i);
@@ -1424,5 +1422,5 @@
 				if( pInheritsClass->IsInterface() ){
 					// クラスを継承していないとき
-					CClass *pObjectClass = Find("Object");
+					const CClass *pObjectClass = Find("Object");
 					if( !pObjectClass ){
 						SetError(106,"Object",i);
@@ -1806,5 +1804,6 @@
 	}
 }
-CClass *CDBClass::GetNowCompilingClass(){
+const CClass *CDBClass::GetNowCompilingClass() const
+{
 	return pCompilingClass;
 }
