Revert name pos move

This commit is contained in:
JohnnyMorganz 2022-10-28 16:27:02 +01:00
parent a6b4064be7
commit 06e3cd43c1

View file

@ -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<TypeId> 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<ClassTypeVar>(classTy);
TypeId metaTy = addType(TableTypeVar{TableState::Sealed, scope->level});