Skip to content

Commit adee0c8

Browse files
Make storage layout specifier accept signed positive expressions
1 parent 65a3ac2 commit adee0c8

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
@@ -1,6 +1,7 @@
11
### 0.8.35 (unreleased)
22

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

67
Compiler Features:

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)