Radar · Solidity · Archive · Week 18 · Apr 27 – May 3, 2026
Keyword promotion warnings for Solidity identifiers
Worth knowinglanguage
- What changed
- The compiler now warns when identifiers that may be promoted to Solidity or Yul keywords are used (
at,error,layout,leave,super,transient,this). - Production impact
- The source does not say.
- Try it
- Declare a variable named
errorand observe the warning. - Source
- github.com/argotorg/solidity/releases/tag/v0.8.35
Understand it, then run it
Solidity 0.8.35 adds a new warning system. If you write an identifier that the compiler plans to turn into a keyword in a future release—such as at, error, layout, leave, super, transient, or this—the compiler will now emit a warning. The warning tells you that the name may become reserved, so you should rename it to avoid future breaking changes. This change does not alter the language semantics; it only informs you about potential future conflicts.
Run it now
// main.sol
pragma solidity ^0.8.37;
// This contract demonstrates the new keyword‑promotion warnings.
// The compiler will warn about the identifiers `error`, `layout`, and `super`.
// The warnings do not affect compilation or execution.
contract KeywordPromotionDemo {
// Warning: identifier 'error' may be promoted to a keyword
uint256 public error;
// Warning: identifier 'layout' may be promoted to a keyword
string public layout;
// Warning: identifier 'super' may be promoted to a keyword
function super() public pure returns (string memory) {
return "super function";
}
}
Tests
// test.sol
pragma solidity ^0.8.37;
import "./main.sol";
contract KeywordPromotionDemoTest {
KeywordPromotionDemo demo;
constructor() {
demo = new KeywordPromotionDemo();
}
function test_errorVariable() public view {
require(demo.error() == 0, "error variable not zero");
}
function test_layoutVariable() public view {
require(bytes(demo.layout()).length == 0, "layout variable not empty");
}
function test_superFunction() public view {
require(
keccak256(bytes(demo.super())) == keccak256(bytes("super function")),
"super function returned wrong string"
);
}
}
The test report when we ran it on Solidity 0.8.37 (solc)
3 of 3 tests passed.
- test_errorVariable28,512 gas
- test_layoutVariable29,406 gas
- test_superFunction27,026 gas
- KeywordPromotionDemoTest: 1,622 bytes of bytecode, deployed for 429,798 gas
solc 0.8.37 · prague
Run sends this program (for Solidity, the contract and its tests) to our own sandbox, where it is compiled and run once, with no network, and what it printed or the test report comes back here. Nothing is kept. Runs are counted per visitor for the day so everyone gets a turn; the details are on the legal page.
Written by gpt-oss-20b from the linked source · claims checked against the sources · archive, not individually reviewed