Skip to content

Commit f27bc10

Browse files
Make storage layout specifier accept signed positive expressions
1 parent b84b57b commit f27bc10

File tree

2 files changed

+1
-12
lines changed

2 files changed

+1
-12
lines changed

Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
Language Features:
44
* General: Add a builtin that computes the base slot of a storage namespace using the `erc7201` formula from ERC-7201.
5+
* Custom Storage Layout: Allow signed positive expressions.
56

67
Compiler Features:
78
* Commandline Interface: Disallow selecting the deprecated assembly input mode that was only accessible via `--assemble` instead of treating it as equivalent to `--strict-assembly`.

libsolidity/analysis/PostTypeContractLevelChecker.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -181,18 +181,6 @@ void PostTypeContractLevelChecker::checkStorageLayoutSpecifier(ContractDefinitio
181181
return;
182182
}
183183

184-
if (!baseSlotExpressionType->isImplicitlyConvertibleTo(*TypeProvider::uint256()))
185-
{
186-
m_errorReporter.typeError(
187-
1481_error,
188-
baseSlotExpression.location(),
189-
fmt::format(
190-
"Base slot expression of type '{}' is not convertible to uint256.",
191-
baseSlotExpressionType->humanReadableName()
192-
)
193-
);
194-
return;
195-
}
196184
storageLayoutSpecifier->annotation().baseSlot = u256(baseSlot);
197185

198186
bigint size = contractStorageSizeUpperBound(_contract, VariableDeclaration::Location::Unspecified);

0 commit comments

Comments
 (0)