From 06e3cd43c12bb19ae50563c16c0ce8a8f4823438 Mon Sep 17 00:00:00 2001 From: JohnnyMorganz Date: Fri, 28 Oct 2022 16:27:02 +0100 Subject: [PATCH] Revert name pos move --- Analysis/src/TypeInfer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Analysis/src/TypeInfer.cpp b/Analysis/src/TypeInfer.cpp index 4d34d56e..47fc46bd 100644 --- a/Analysis/src/TypeInfer.cpp +++ b/Analysis/src/TypeInfer.cpp @@ -1633,8 +1633,6 @@ void TypeChecker::prototype(const ScopePtr& scope, const AstStatTypeAlias& typea void TypeChecker::prototype(const ScopePtr& scope, const AstStatDeclareClass& declaredClass) { - Name className(declaredClass.name.value); - std::optional superTy = std::nullopt; if (declaredClass.superName) { @@ -1661,6 +1659,8 @@ void TypeChecker::prototype(const ScopePtr& scope, const AstStatDeclareClass& de } } + Name className(declaredClass.name.value); + TypeId classTy = addType(ClassTypeVar(className, {}, superTy, std::nullopt, {}, {}, currentModuleName)); ClassTypeVar* ctv = getMutable(classTy); TypeId metaTy = addType(TableTypeVar{TableState::Sealed, scope->level});