mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Better error messages when writing to expressions that cannot be written to.
This commit is contained in:
@@ -432,8 +432,13 @@ string Scopable::sourceUnitName() const
|
||||
|
||||
bool VariableDeclaration::isLValue() const
|
||||
{
|
||||
// External function parameters and constant declared variables are Read-Only
|
||||
return !isExternalCallableParameter() && !m_isConstant;
|
||||
// Constant declared variables are Read-Only
|
||||
if (m_isConstant)
|
||||
return false;
|
||||
// External function arguments of reference type are Read-Only
|
||||
if (isExternalCallableParameter() && dynamic_cast<ReferenceType const*>(type()))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool VariableDeclaration::isLocalVariable() const
|
||||
|
||||
Reference in New Issue
Block a user