[libsolidity] remove ReferenceType::copyForLocationIfReference (use TypeProvider instead)

This commit is contained in:
Christian Parpart
2019-04-17 13:25:03 +02:00
parent b83097bdc6
commit 862b65d6e3
5 changed files with 9 additions and 21 deletions
+2 -2
View File
@@ -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);
}
+2 -2
View File
@@ -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
);