fixup! Type inference draft.

This commit is contained in:
Kamil Śliwak 2023-09-19 16:46:48 +02:00
parent 6d43dfbd43
commit ff06778fee

View File

@ -54,11 +54,11 @@ TypeInference::TypeInference(Analysis& _analysis):
); );
if (auto error = std::get_if<std::string>(&result)) if (auto error = std::get_if<std::string>(&result))
solAssert(!error, *error); solAssert(!error, *error);
TypeClass resultClass = std::get<TypeClass>(result); TypeClass declaredClass = std::get<TypeClass>(result);
// TODO: validation? // TODO: validation?
annotation().typeClassFunctions[resultClass] = _memberCreator(type); annotation().typeClassFunctions[declaredClass] = _memberCreator(type);
solAssert(annotation().builtinClassesByName.emplace(_name, _class).second); solAssert(annotation().builtinClassesByName.emplace(_name, _class).second);
return annotation().builtinClasses.emplace(_class, resultClass).first->second; return annotation().builtinClasses.emplace(_class, declaredClass).first->second;
}; };
TypeSystemHelpers helper{m_typeSystem}; TypeSystemHelpers helper{m_typeSystem};
using MemberList = std::map<std::string, Type>; using MemberList = std::map<std::string, Type>;