| 464 | } |
| 465 | |
| 466 | void ContractLevelChecker::checkExternalTypeClashes(ContractDefinition const& _contract) |
| 467 | { |
| 468 | std::map<std::string, std::vector<std::pair<Declaration const*, FunctionTypePointer>>> externalDeclarations; |
| 469 | for (ContractDefinition const* contract: _contract.annotation().linearizedBaseContracts) |
| 470 | { |
| 471 | for (FunctionDefinition const* f: contract->definedFunctions()) |
| 472 | if (f->isPartOfExternalInterface()) |
| 473 | { |
| 474 | auto functionType = TypeProvider::function(*f); |
| 475 | // under non error circumstances this should be true |
| 476 | if (functionType->interfaceFunctionType()) |
| 477 | externalDeclarations[functionType->externalSignature()].emplace_back( |
| 478 | f, functionType->asExternallyCallableFunction(false) |
| 479 | ); |
| 480 | } |
| 481 | for (VariableDeclaration const* v: contract->stateVariables()) |
| 482 | if (v->isPartOfExternalInterface()) |
| 483 | { |
| 484 | auto functionType = TypeProvider::function(*v); |
| 485 | // under non error circumstances this should be true |
| 486 | if (functionType->interfaceFunctionType()) |
| 487 | externalDeclarations[functionType->externalSignature()].emplace_back( |
| 488 | v, functionType->asExternallyCallableFunction(false) |
| 489 | ); |
| 490 | } |
| 491 | } |
| 492 | for (auto const& it: externalDeclarations) |
| 493 | for (size_t i = 0; i < it.second.size(); ++i) |
| 494 | for (size_t j = i + 1; j < it.second.size(); ++j) |
| 495 | if (!it.second[i].second->hasEqualParameterTypes(*it.second[j].second)) |
| 496 | m_errorReporter.typeError( |
| 497 | 9914_error, |
| 498 | it.second[j].first->location(), |
| 499 | "Function overload clash during conversion to external types for arguments." |
| 500 | ); |
| 501 | } |
| 502 | |
| 503 | void ContractLevelChecker::checkHashCollisions(ContractDefinition const& _contract) |
| 504 | { |
nothing calls this directly
no test coverage detected