| 55 | { |
| 56 | |
| 57 | Type const* closestType(Type const* _type, Type const* _targetType, bool _isShiftOp) |
| 58 | { |
| 59 | if (_isShiftOp) |
| 60 | return _type->mobileType(); |
| 61 | else if (auto const* tupleType = dynamic_cast<TupleType const*>(_type)) |
| 62 | { |
| 63 | solAssert(_targetType, ""); |
| 64 | TypePointers const& targetComponents = dynamic_cast<TupleType const&>(*_targetType).components(); |
| 65 | solAssert(tupleType->components().size() == targetComponents.size(), ""); |
| 66 | TypePointers tempComponents(targetComponents.size()); |
| 67 | for (size_t i = 0; i < targetComponents.size(); ++i) |
| 68 | { |
| 69 | if (tupleType->components()[i] && targetComponents[i]) |
| 70 | { |
| 71 | tempComponents[i] = closestType(tupleType->components()[i], targetComponents[i], _isShiftOp); |
| 72 | solAssert(tempComponents[i], ""); |
| 73 | } |
| 74 | } |
| 75 | return TypeProvider::tuple(std::move(tempComponents)); |
| 76 | } |
| 77 | else |
| 78 | return _targetType->dataStoredIn(DataLocation::Storage) ? _type->mobileType() : _targetType; |
| 79 | } |
| 80 | |
| 81 | } |
| 82 |
no test coverage detected