| 297 | } |
| 298 | |
| 299 | std::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 | |
| 316 | experimental::Type TypeSystem::type(TypeConstructor _constructor, std::vector<Type> _arguments) const |
| 317 | { |
no test coverage detected