Index: /BasicCompiler32/Compile_Func.cpp
===================================================================
--- /BasicCompiler32/Compile_Func.cpp	(revision 113)
+++ /BasicCompiler32/Compile_Func.cpp	(revision 114)
@@ -176,5 +176,5 @@
 		tempParm=temp2;
 
-		extern CClass *pobj_StringClass;
+		extern const CClass *pobj_StringClass;
 		type.SetType( DEF_OBJECT, pobj_StringClass );
 	}
@@ -250,5 +250,5 @@
 		///////////////////////////////
 
-		CClass *pobj_c;
+		const CClass *pobj_c;
 
 		char ObjectName[VN_SIZE];
Index: /BasicCompiler32/NumOpe.cpp
===================================================================
--- /BasicCompiler32/NumOpe.cpp	(revision 113)
+++ /BasicCompiler32/NumOpe.cpp	(revision 114)
@@ -77,5 +77,5 @@
 	SetStringQuotes( parameter );
 
-	extern CClass *pobj_StringClass;
+	extern const CClass *pobj_StringClass;
 	Operator_New( *pobj_StringClass, "", parameter, Type( DEF_OBJECT, *pobj_StringClass ) );
 
@@ -719,5 +719,5 @@
 						NewStringObject(term);
 
-						extern CClass *pobj_StringClass;
+						extern const CClass *pobj_StringClass;
 						type_stack[sp]=DEF_OBJECT;
 						index_stack[sp]=(LONG_PTR)pobj_StringClass;
Index: /BasicCompiler_Common/Class.cpp
===================================================================
--- /BasicCompiler_Common/Class.cpp	(revision 113)
+++ /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;
 }
Index: /BasicCompiler_Common/Class.h
===================================================================
--- /BasicCompiler_Common/Class.h	(revision 113)
+++ /BasicCompiler_Common/Class.h	(revision 114)
@@ -48,5 +48,5 @@
 	bool isStatic;
 
-	CClass *pobj_InheritsClass;
+	const CClass *pobj_InheritsClass;
 
 	CMethod(CMethod *pobj);
@@ -87,5 +87,5 @@
 	ClassType classType;
 
-	bool isUsing;
+	mutable bool isUsing;
 
 public:
@@ -94,5 +94,5 @@
 
 	//継承クラスへのポインタ
-	CClass *pobj_InheritsClass;
+	const CClass *pobj_InheritsClass;
 
 	//メンバ情報
@@ -130,5 +130,5 @@
 
 	bool IsUsing() const;
-	void Using();
+	void Using() const;
 
 	bool IsClass() const;
@@ -139,6 +139,6 @@
 
 	//継承させる
-	bool Inherits( CClass &inheritsClass, int nowLine );
-	bool InheritsInterface( CClass &inheritsClass, int nowLine );
+	bool Inherits( const CClass &inheritsClass, int nowLine );
+	bool InheritsInterface( const CClass &inheritsClass, int nowLine );
 
 	//メンバ、メソッドの追加
@@ -192,8 +192,8 @@
 	//vtbl
 private:
-	long vtbl_offset;
+	mutable long vtbl_offset;
 public:
 	int GetFuncNumInVtbl( const UserProc *pUserProc ) const;
-	LONG_PTR GetVtblGlobalOffset(void);
+	LONG_PTR GetVtblGlobalOffset(void) const;
 	void ActionVtblSchedule(LONG_PTR ImageBase, LONG_PTR MemPos_CodeSection);
 	bool IsAbstract() const;
@@ -202,16 +202,16 @@
 	//コンストラクタをコンパイルしているかどうかのチェックフラグ
 private:
-	bool isCompilingConstructor;
-public:
-	void NotifyStartConstructorCompile();
-	void NotifyFinishConstructorCompile();
+	mutable bool isCompilingConstructor;
+public:
+	void NotifyStartConstructorCompile() const;
+	void NotifyFinishConstructorCompile() const;
 	bool IsCompilingConstructor() const;
 
 	//デストラクタをコンパイルしているかどうかのチェックフラグ
 private:
-	bool isCompilingDestructor;
-public:
-	void NotifyStartDestructorCompile();
-	void NotifyFinishDestructorCompile();
+	mutable bool isCompilingDestructor;
+public:
+	void NotifyStartDestructorCompile() const;
+	void NotifyFinishDestructorCompile() const;
 	bool IsCompilingDestructor() const;
 
@@ -252,6 +252,6 @@
 	~CDBClass();
 
-	CClass *Find( const string &fullName ) const;
-	CClass *Find( const NamespaceScopes &namespaceScopes, const string &name ) const;
+	const CClass *Find( const string &fullName ) const;
+	const CClass *Find( const NamespaceScopes &namespaceScopes, const string &name ) const;
 
 	CClass *AddClass( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const char *name,int nowLine);
@@ -283,5 +283,5 @@
 	/////////////////////////////
 private:
-	CClass *pCompilingClass;
+	const CClass *pCompilingClass;
 	CMethod *pCompilingMethod;
 public:
@@ -290,5 +290,5 @@
 
 	//現在コンパイル中のメソッド情報を取得
-	CClass *GetNowCompilingClass();
+	const CClass *GetNowCompilingClass() const;
 	CMethod *GetNowCompilingMethodInfo();
 
@@ -311,3 +311,3 @@
 
 extern CDBClass *pobj_DBClass;
-extern CClass *pobj_CompilingClass;
+extern const CClass *pobj_CompilingClass;
Index: /BasicCompiler_Common/DebugMiddleFile.cpp
===================================================================
--- /BasicCompiler_Common/DebugMiddleFile.cpp	(revision 113)
+++ /BasicCompiler_Common/DebugMiddleFile.cpp	(revision 114)
@@ -428,6 +428,5 @@
 	char temp2[MAX_PATH],*temp5;
 
-	extern CClass *pobj_CompilingClass;
-	pobj_CompilingClass=0;
+	pobj_CompilingClass = NULL;
 
 	i2=0;
@@ -585,7 +584,8 @@
 		i2+=lstrlen(buffer+i2)+1;
 
-		CClass *pClass = NULL;
-		if(szParentClassName[0])
+		const CClass *pClass = NULL;
+		if(szParentClassName[0]){
 			pClass=pobj_DBClass->Find(szParentClassName);
+		}
 
 		//ID
@@ -691,5 +691,5 @@
 		i2+=lstrlen(buffer+i2)+1;
 
-		pobj_c=pobj_DBClass->Find(szClassName);
+		pobj_c =  const_cast<CClass *>( pobj_DBClass->Find(szClassName) );
 
 		//仮想関数の数
@@ -741,5 +741,5 @@
 			i2+=lstrlen(buffer+i2)+1;
 
-			CClass *pobj_InheritsClass = NULL;
+			const CClass *pobj_InheritsClass = NULL;
 			if(szInherits[0]){
 				pobj_InheritsClass=pobj_DBClass->Find(szInherits);
@@ -749,5 +749,5 @@
 			i2+=lstrlen(buffer+i2)+1;
 
-			CClass *pobj_temp_c;
+			const CClass *pobj_temp_c;
 			pobj_temp_c=pobj_InheritsClass;
 			if(pobj_temp_c==0) pobj_temp_c=pobj_c;
Index: /BasicCompiler_Common/NumOpe_GetType.cpp
===================================================================
--- /BasicCompiler_Common/NumOpe_GetType.cpp	(revision 113)
+++ /BasicCompiler_Common/NumOpe_GetType.cpp	(revision 114)
@@ -634,5 +634,5 @@
 					if( baseType.IsObject() || baseType.IsNull() ){
 						//要求タイプがオブジェクト、または未定のとき
-						extern CClass *pobj_StringClass;
+						extern const CClass *pobj_StringClass;
 						type_stack[sp]=DEF_OBJECT;
 						index_stack[sp]=(LONG_PTR)pobj_StringClass;
@@ -658,5 +658,5 @@
 					// 何らかの識別子
 
-						if( (string)term=="ParentArea2.xxxxxx"){
+						if( strstr(term,"T.B")){
 							int test=0;
 						}
Index: /BasicCompiler_Common/Procedure.h
===================================================================
--- /BasicCompiler_Common/Procedure.h	(revision 113)
+++ /BasicCompiler_Common/Procedure.h	(revision 114)
@@ -106,5 +106,5 @@
 
 	// 親クラスと対応するメソッド
-	CClass *pParentClass;
+	const CClass *pParentClass;
 	CMethod *pMethod;
 
@@ -158,8 +158,8 @@
 	}
 
-	void SetParentClass( CClass *pParentClass ){
+	void SetParentClass( const CClass *pParentClass ){
 		this->pParentClass = pParentClass;
 	}
-	CClass *GetParentClassPtr()
+	const CClass *GetParentClassPtr()
 	{
 		return pParentClass;
Index: /BasicCompiler_Common/Type.cpp
===================================================================
--- /BasicCompiler_Common/Type.cpp	(revision 113)
+++ /BasicCompiler_Common/Type.cpp	(revision 114)
@@ -96,5 +96,5 @@
 
 	//クラス
-	CClass *pobj_c = pobj_DBClass->Find( typeName.c_str() );
+	const CClass *pobj_c = pobj_DBClass->Find( typeName.c_str() );
 	if(pobj_c){
 		type.pClass = pobj_c;
@@ -507,5 +507,5 @@
 
 Type Type::String(){
-	extern CClass *pobj_StringClass;
+	extern const CClass *pobj_StringClass;
 	if( pobj_StringClass == NULL ){
 		SetError();
Index: /BasicCompiler_Common/Type.h
===================================================================
--- /BasicCompiler_Common/Type.h	(revision 113)
+++ /BasicCompiler_Common/Type.h	(revision 114)
@@ -7,5 +7,5 @@
 	union{
 		LONG_PTR index;
-		CClass *pClass;
+		const CClass *pClass;
 	};
 
@@ -59,5 +59,5 @@
 		SetIndex( index );
 	}
-	void SetType( int basicType, CClass *pClass ){
+	void SetType( int basicType, const CClass *pClass ){
 		SetBasicType( basicType );
 		this->pClass = pClass;
Index: /BasicCompiler_Common/TypeDef.cpp
===================================================================
--- /BasicCompiler_Common/TypeDef.cpp	(revision 113)
+++ /BasicCompiler_Common/TypeDef.cpp	(revision 114)
@@ -57,12 +57,19 @@
 	this->push_back( typeDef );
 }
-int TypeDefCollection::GetIndex( const string &typeName ) const{
+int TypeDefCollection::GetIndex( const NamespaceScopes &namespaceScopes, const string &name ) const{
 	int max = (int)(*this).size();
 	for( int i=0; i<max; i++ ){
-		if( (*this)[i].IsEqualSymbol( typeName ) ){
+		if( (*this)[i].IsEqualSymbol( namespaceScopes, name ) ){
 			return i;
 		}
 	}
 	return -1;
+}
+int TypeDefCollection::GetIndex( const string &fullName ) const{
+	char AreaName[VN_SIZE] = "";		//オブジェクト変数
+	char NestName[VN_SIZE] = "";		//入れ子メンバ
+	bool isNest = SplitMemberName( fullName.c_str(), AreaName, NestName );
+
+	return GetIndex( NamespaceScopes( AreaName ), NestName );
 }
 
Index: /BasicCompiler_Common/TypeDef.h
===================================================================
--- /BasicCompiler_Common/TypeDef.h	(revision 113)
+++ /BasicCompiler_Common/TypeDef.h	(revision 114)
@@ -46,5 +46,6 @@
 
 	void Add( const NamespaceScopes &namespaceScopes, const string &name, const string &baseName );
-	int GetIndex( const string &typeName ) const;
+	int GetIndex( const NamespaceScopes &namespaceScopes, const string &name ) const;
+	int GetIndex( const string &fullName ) const;
 
 private:
Index: /BasicCompiler_Common/VarList.cpp
===================================================================
--- /BasicCompiler_Common/VarList.cpp	(revision 113)
+++ /BasicCompiler_Common/VarList.cpp	(revision 114)
@@ -726,5 +726,5 @@
 
 		if(pUserProc){
-			pobj_CompilingClass=pUserProc->GetParentClassPtr();
+			pobj_CompilingClass = pUserProc->GetParentClassPtr();
 			UserProc::CompileStartForUserProc( pUserProc );
 		}
Index: /BasicCompiler_Common/VariableOpe.cpp
===================================================================
--- /BasicCompiler_Common/VariableOpe.cpp	(revision 113)
+++ /BasicCompiler_Common/VariableOpe.cpp	(revision 114)
@@ -235,5 +235,5 @@
 
 Type GetStringTypeInfo(){
-	extern CClass *pobj_StringClass;
+	extern const CClass *pobj_StringClass;
 	Type type( DEF_OBJECT, *pobj_StringClass );
 	return type;
@@ -732,4 +732,6 @@
 		}
 
+		// TODO: TypeDefされたクラスの静的メンバに未対応
+
 		char temp2[VN_SIZE];
 		sprintf(temp2,"%s.%s",VarName,temporary);
Index: /BasicCompiler_Common/common.h
===================================================================
--- /BasicCompiler_Common/common.h	(revision 113)
+++ /BasicCompiler_Common/common.h	(revision 114)
@@ -47,7 +47,7 @@
 
 #ifdef _AMD64_
-#define VER_INFO		"(x64) β rev.234"
+#define VER_INFO		"(x64) β rev.243"
 #else
-#define VER_INFO		"β rev.234"
+#define VER_INFO		"β rev.243"
 #endif
 
Index: /BasicCompiler_Common/error.cpp
===================================================================
--- /BasicCompiler_Common/error.cpp	(revision 113)
+++ /BasicCompiler_Common/error.cpp	(revision 114)
@@ -465,5 +465,5 @@
 			//双方がオブジェクトポインタ型の場合
 			if(lpVarIndex!=lpCalcIndex){
-				CClass *pobj_tempClass;
+				const CClass *pobj_tempClass;
 				pobj_tempClass=(CClass *)lpCalcIndex;
 				while(pobj_tempClass&&(!IS_LITERAL((LONG_PTR)pobj_tempClass))){
Index: /BasicCompiler_Common/hash.cpp
===================================================================
--- /BasicCompiler_Common/hash.cpp	(revision 113)
+++ /BasicCompiler_Common/hash.cpp	(revision 114)
@@ -187,5 +187,5 @@
 
 UserProc *GetClassMethod( const char *className, const char *methodName ){
-	CClass *pClass = pobj_DBClass->Find( className );
+	const CClass *pClass = pobj_DBClass->Find( className );
 	if( pClass ){
 		vector<UserProc *> userProcs;
