--- a/cmajor++/Cm/Cm.Core/Variable.hpp
+++ b/cmajor++/Cm/Cm.Core/Variable.hpp
@@ -38,7 +38,6 @@
     void SetSpecifiers(Specifiers specifiers_) { specifiers = specifiers_; }
     const std::string& AssemblyName() const { return assemblyName; }
     void SetAssemblyName(const std::string& assemblyName_) { assemblyName = assemblyName_; }
-    virtual void CollectExternalObjects(CompilationUnitPtr compilationUnit, ObjectSet& externalObjects, bool deep);
     virtual std::string ObjectKindStr() const { return "variable"; }
     virtual ObjectKind GetObjectKind() const { return ObjectKind::variable; }
     virtual GenResult Gen(Ir& ir, GenFlags flags);
@@ -59,6 +58,7 @@
     virtual ObjectPtr Clone(CloneContext& context) const;
     virtual bool IsLocalVariable() const { return true; }
     virtual void CollectLocalVariables(LocalVariableList& vars);
+    virtual void TypeCheckBody(TypeCheckContext& context);
     bool Collected() const { return collected; }
     void SetCollected() { collected = true; }
 private:
@@ -75,10 +75,11 @@
     virtual bool IsMemberVariable() const { return true; }
     int VarIndex() const { return varIndex; }
     void SetVarIndex(int varIndex_) { varIndex = varIndex_; }
-    void SetClassType(const ClassTypePtr& classType_) { classType = classType_; }
-    virtual ClassTypePtr GetClassType() const { return classType.lock(); }
+    void SetClassType(const ClassTypePtr& ownerClassType_) { ownerClassType = ownerClassType_; }
+    virtual ClassTypePtr GetClassType() const { return ownerClassType.lock(); }
     virtual bool IsClassLevelObject() const { return true; }
     virtual void TypeCheckSignature(TypeCheckContext& context);
+    virtual void TypeCheckBody(TypeCheckContext& context);
     virtual bool IsStatic() const { return (GetSpecifiers() & Specifiers::static_) != Specifiers::none; }
     virtual bool IsExternal() const { return (GetSpecifiers() & Specifiers::external) != Specifiers::none; }
     virtual void GenerateIntermediateCode(CodeFormatter& formatter);
@@ -87,7 +88,7 @@
     void SetInitializedVar() { isInitializedVar = true; }
 private:
     int varIndex;
-    WeakClassTypePtr classType;
+    WeakClassTypePtr ownerClassType;
     Llvm::Ir::ObjectPtr destructionNode;
     bool isInitializedVar;
 };
@@ -102,6 +103,7 @@
     virtual ObjectPtr Clone(CloneContext& context) const;
     virtual bool IsThisVariable() const { return true; }
     virtual void CollectLocalVariables(LocalVariableList& vars) {}
+    virtual void TypeCheckBody(TypeCheckContext& context);
     virtual GenResult Gen(Ir& ir, GenFlags flags);
 private:
     WeakTypePtr classType;