mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge remote-tracking branch 'origin/develop' into breaking
This commit is contained in:
@@ -113,14 +113,22 @@ public:
|
||||
/// @returns a copy of @a _type having the same location as this (and is not a pointer type)
|
||||
/// if _type is a reference type and an unmodified copy of _type otherwise.
|
||||
/// This function is mostly useful to modify inner types appropriately.
|
||||
static Type const* withLocationIfReference(DataLocation _location, Type const* _type)
|
||||
static Type const* withLocationIfReference(DataLocation _location, Type const* _type, bool _isPointer = false)
|
||||
{
|
||||
if (auto refType = dynamic_cast<ReferenceType const*>(_type))
|
||||
return withLocation(refType, _location, false);
|
||||
return withLocation(refType, _location, _isPointer);
|
||||
|
||||
return _type;
|
||||
}
|
||||
|
||||
static bool isReferenceWithLocation(Type const* _type, DataLocation _location)
|
||||
{
|
||||
if (auto const* refType = dynamic_cast<ReferenceType const*>(_type))
|
||||
if (refType->location() == _location)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/// @returns the internally-facing or externally-facing type of a function or the type of a function declaration.
|
||||
static FunctionType const* function(FunctionDefinition const& _function, FunctionType::Kind _kind = FunctionType::Kind::Declaration);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user