| 3769 | } |
| 3770 | |
| 3771 | FunctionTypePointer FunctionType::asExternallyCallableFunction(bool _inLibrary) const |
| 3772 | { |
| 3773 | TypePointers parameterTypes; |
| 3774 | for (auto const& t: m_parameterTypes) |
| 3775 | if (TypeProvider::isReferenceWithLocation(t, DataLocation::CallData)) |
| 3776 | parameterTypes.push_back( |
| 3777 | TypeProvider::withLocationIfReference(DataLocation::Memory, t, true) |
| 3778 | ); |
| 3779 | else |
| 3780 | parameterTypes.push_back(t); |
| 3781 | |
| 3782 | TypePointers returnParameterTypes; |
| 3783 | for (auto const& returnParamType: m_returnParameterTypes) |
| 3784 | if (TypeProvider::isReferenceWithLocation(returnParamType, DataLocation::CallData)) |
| 3785 | returnParameterTypes.push_back( |
| 3786 | TypeProvider::withLocationIfReference(DataLocation::Memory, returnParamType, true) |
| 3787 | ); |
| 3788 | else |
| 3789 | returnParameterTypes.push_back(returnParamType); |
| 3790 | |
| 3791 | Kind kind = m_kind; |
| 3792 | if (_inLibrary) |
| 3793 | { |
| 3794 | solAssert(!!m_declaration, "Declaration has to be available."); |
| 3795 | solAssert(m_declaration->isPublic(), ""); |
| 3796 | kind = Kind::DelegateCall; |
| 3797 | } |
| 3798 | |
| 3799 | return TypeProvider::function( |
| 3800 | parameterTypes, |
| 3801 | returnParameterTypes, |
| 3802 | m_parameterNames, |
| 3803 | m_returnParameterNames, |
| 3804 | kind, |
| 3805 | m_stateMutability, |
| 3806 | m_declaration, |
| 3807 | Options::fromFunctionType(*this) |
| 3808 | ); |
| 3809 | } |
| 3810 | |
| 3811 | Type const* FunctionType::selfType() const |
| 3812 | { |
no test coverage detected