mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
[libsolidity] remove ReferenceType::copyForLocationIfReference (use TypeProvider instead)
This commit is contained in:
@@ -231,9 +231,9 @@ void ReferencesResolver::endVisit(Mapping const& _typeName)
|
||||
TypePointer keyType = _typeName.keyType().annotation().type;
|
||||
TypePointer valueType = _typeName.valueType().annotation().type;
|
||||
// Convert key type to memory.
|
||||
keyType = ReferenceType::copyForLocationIfReference(DataLocation::Memory, keyType);
|
||||
keyType = TypeProvider::withLocationIfReference(DataLocation::Memory, keyType);
|
||||
// Convert value type to storage reference.
|
||||
valueType = ReferenceType::copyForLocationIfReference(DataLocation::Storage, valueType);
|
||||
valueType = TypeProvider::withLocationIfReference(DataLocation::Storage, valueType);
|
||||
_typeName.annotation().type = TypeProvider::mappingType(keyType, valueType);
|
||||
}
|
||||
|
||||
|
||||
@@ -1997,7 +1997,7 @@ void TypeChecker::endVisit(NewExpression const& _newExpression)
|
||||
_newExpression.typeName().location(),
|
||||
"Length has to be placed in parentheses after the array type for new expression."
|
||||
);
|
||||
type = ReferenceType::copyForLocationIfReference(DataLocation::Memory, type);
|
||||
type = TypeProvider::withLocationIfReference(DataLocation::Memory, type);
|
||||
_newExpression.annotation().type = TypeProvider::functionType(
|
||||
TypePointers{TypeProvider::uint256()},
|
||||
TypePointers{type},
|
||||
@@ -2043,7 +2043,7 @@ bool TypeChecker::visit(MemberAccess const& _memberAccess)
|
||||
if (initialMemberCount == 0)
|
||||
{
|
||||
// Try to see if the member was removed because it is only available for storage types.
|
||||
auto storageType = ReferenceType::copyForLocationIfReference(
|
||||
auto storageType = TypeProvider::withLocationIfReference(
|
||||
DataLocation::Storage,
|
||||
exprType
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user