| 41 | } |
| 42 | |
| 43 | bool 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 | } |
nothing calls this directly
no test coverage detected