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

Method visit

libsolidity/experimental/analysis/TypeClassRegistration.cpp:43–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41}
42
43bool TypeClassRegistration::visit(TypeClassDefinition const& _typeClassDefinition)
44{
45 std::variant<TypeClass, std::string> typeClassOrError = m_typeSystem.declareTypeClass(
46 _typeClassDefinition.name(),
47 &_typeClassDefinition
48 );
49
50 m_analysis.annotation<TypeClassRegistration>(_typeClassDefinition).typeClass = std::visit(
51 util::GenericVisitor{
52 [](TypeClass _class) -> TypeClass { return _class; },
53 [&](std::string _error) -> TypeClass {
54 m_errorReporter.fatalTypeError(4767_error, _typeClassDefinition.location(), _error);
55 util::unreachable();
56 }
57 },
58 typeClassOrError
59 );
60
61 return true;
62}

Callers

nothing calls this directly

Calls 5

unreachableFunction · 0.85
declareTypeClassMethod · 0.80
fatalTypeErrorMethod · 0.80
nameMethod · 0.45
locationMethod · 0.45

Tested by

no test coverage detected