| 3363 | } |
| 3364 | |
| 3365 | FunctionTypePointer FunctionType::interfaceFunctionType() const |
| 3366 | { |
| 3367 | // Note that m_declaration might also be a state variable! |
| 3368 | solAssert(m_declaration, "Declaration needed to determine interface function type."); |
| 3369 | bool isLibraryFunction = false; |
| 3370 | if (kind() != Kind::Event && kind() != Kind::Error) |
| 3371 | if (auto const* contract = dynamic_cast<ContractDefinition const*>(m_declaration->scope())) |
| 3372 | isLibraryFunction = contract->isLibrary(); |
| 3373 | |
| 3374 | util::Result<TypePointers> paramTypes = |
| 3375 | transformParametersToExternal(m_parameterTypes, isLibraryFunction); |
| 3376 | |
| 3377 | if (!paramTypes.message().empty()) |
| 3378 | return FunctionTypePointer(); |
| 3379 | |
| 3380 | util::Result<TypePointers> retParamTypes = |
| 3381 | transformParametersToExternal(m_returnParameterTypes, isLibraryFunction); |
| 3382 | |
| 3383 | if (!retParamTypes.message().empty()) |
| 3384 | return FunctionTypePointer(); |
| 3385 | |
| 3386 | auto variable = dynamic_cast<VariableDeclaration const*>(m_declaration); |
| 3387 | if (variable && retParamTypes.get().empty()) |
| 3388 | return FunctionTypePointer(); |
| 3389 | |
| 3390 | solAssert(!takesArbitraryParameters()); |
| 3391 | return TypeProvider::function( |
| 3392 | paramTypes, |
| 3393 | retParamTypes, |
| 3394 | m_parameterNames, |
| 3395 | m_returnParameterNames, |
| 3396 | m_kind, |
| 3397 | m_stateMutability, |
| 3398 | m_declaration |
| 3399 | ); |
| 3400 | } |
| 3401 | |
| 3402 | MemberList::MemberMap FunctionType::nativeMembers(ASTNode const* _scope) const |
| 3403 | { |
no test coverage detected