MCPcopy Create free account
hub / github.com/argotorg/solidity / declareTypeClass

Method declareTypeClass

libsolidity/experimental/ast/TypeSystem.cpp:299–314  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

297}
298
299std::variant<TypeClass, std::string> TypeSystem::declareTypeClass(std::string _name, Declaration const* _declaration, bool _primitive)
300{
301 TypeClass typeClass{m_typeClasses.size()};
302
303 Type typeVariable = (_primitive ? freshVariable({{typeClass}}) : freshTypeVariable({{typeClass}}));
304 solAssert(std::holds_alternative<TypeVariable>(typeVariable));
305
306 m_globalTypeEnvironment.fixTypeVars({typeVariable});
307
308 m_typeClasses.emplace_back(TypeClassInfo{
309 typeVariable,
310 _name,
311 _declaration
312 });
313 return typeClass;
314}
315
316experimental::Type TypeSystem::type(TypeConstructor _constructor, std::vector<Type> _arguments) const
317{

Callers 2

TypeInferenceMethod · 0.80
visitMethod · 0.80

Calls 2

fixTypeVarsMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected