From 5f73cfcec43077b4d1d03ba7832205e1dec55de2 Mon Sep 17 00:00:00 2001 From: Matheus Aguiar Date: Mon, 15 Sep 2025 13:23:13 -0300 Subject: [PATCH 1/3] Warning about Solidity future keywords --- libsolidity/analysis/SyntaxChecker.cpp | 31 ++++++++++++++++++++++++++ libsolidity/analysis/SyntaxChecker.h | 4 ++++ 2 files changed, 35 insertions(+) diff --git a/libsolidity/analysis/SyntaxChecker.cpp b/libsolidity/analysis/SyntaxChecker.cpp index 1e3f5f1c2a56..29baa1f3813a 100644 --- a/libsolidity/analysis/SyntaxChecker.cpp +++ b/libsolidity/analysis/SyntaxChecker.cpp @@ -391,6 +391,9 @@ bool SyntaxChecker::visit(ContractDefinition const& _contract) "Functions are not allowed to have the same name as the contract. " "If you intend this to be a constructor, use \"constructor(...) { ... }\" to define it." ); + + checkFutureKeyword(_contract); + return true; } @@ -477,6 +480,8 @@ bool SyntaxChecker::visit(FunctionDefinition const& _function) else if (!_function.isImplemented() && !_function.modifiers().empty()) m_errorReporter.syntaxError(2668_error, _function.location(), "Functions without implementation cannot have modifiers."); + checkFutureKeyword(_function); + return true; } @@ -508,5 +513,31 @@ bool SyntaxChecker::visitNode(ASTNode const& _node) solAssert(m_sourceUnit); solAssert(m_sourceUnit->experimentalSolidity()); } + auto const* declaration = dynamic_cast(&_node); + if (declaration) + checkFutureKeyword(*declaration); return ASTConstVisitor::visitNode(_node); } + + +void SyntaxChecker::checkFutureKeyword(Declaration const& _declaration) +{ + std::set const futureKeywords = { + "transient", + "layout", + "at", + "error", + "super", + "this" + }; + if (futureKeywords.count(_declaration.name())) + m_errorReporter.warning( + 6335_error, + _declaration.location(), + fmt::format( + "\"{}\" will be promoted to reserved keyword in the next breaking version" + " and will not be allowed as an identifier anymore.", + _declaration.name() + ) + ); +} diff --git a/libsolidity/analysis/SyntaxChecker.h b/libsolidity/analysis/SyntaxChecker.h index 69bda229f701..69039945fd87 100644 --- a/libsolidity/analysis/SyntaxChecker.h +++ b/libsolidity/analysis/SyntaxChecker.h @@ -66,6 +66,10 @@ class SyntaxChecker: private ASTConstVisitor /// without a block. void checkSingleStatementVariableDeclaration(ASTNode const& _statement); + /// Reports a warning if the declaration name is scheduled to be + /// promoted to a keyword in the near future. + void checkFutureKeyword(Declaration const& _declaration); + bool visit(IfStatement const& _ifStatement) override; bool visit(WhileStatement const& _whileStatement) override; void endVisit(WhileStatement const& _whileStatement) override; From 142fe64585a917d0cdd68e680ea0fcce0c82a6bd Mon Sep 17 00:00:00 2001 From: Matheus Aguiar Date: Tue, 23 Sep 2025 14:57:19 -0300 Subject: [PATCH 2/3] Update tests (Solidity keywords) --- .../constants/constant_state_variable_named_transient.sol | 1 + .../dataLocations/data_location_in_function_type_fail.sol | 1 + ...rgument_location_specifier_test_external_transient.sol | 1 + ...rgument_location_specifier_test_internal_transient.sol | 1 + .../library_function_with_data_location_transient.sol | 8 ++++++++ ...rgument_location_specifier_test_external_transient.sol | 1 + ...rgument_location_specifier_test_internal_transient.sol | 1 + .../private_function_parameters_location_transient.sol | 1 + ...vate_function_return_parameters_location_transient.sol | 1 + ..._argument_location_specifier_test_public_transient.sol | 1 + ...blic_function_return_parameters_location_transient.sol | 1 + .../dataLocations/transient_function_type_parameter.sol | 1 + .../duplicateFunctions/illegal_names_exception.sol | 2 ++ .../duplicateFunctions/illegal_names_functions.sol | 2 ++ test/libsolidity/syntaxTests/enums/illegal_names.sol | 4 ++++ .../syntaxTests/events/illegal_names_exception.sol | 2 ++ .../events/illegal_names_exception_file_level.sol | 3 +++ .../syntaxTests/freeFunctions/illegal_names.sol | 2 ++ .../functionTypes/function_type_with_transient_param.sol | 2 ++ test/libsolidity/syntaxTests/immutable/illegal_names.sol | 2 ++ .../immutable/immutable_state_var_named_transient.sol | 1 + .../syntaxTests/modifiers/transient_parameter.sol | 1 + .../shadowsBuiltin/illegal_names_function_parameters.sol | 4 ++++ .../shadowsBuiltin/illegal_names_library_using_for.sol | 2 ++ .../nameAndTypeResolution/shadowsBuiltin/this_super.sol | 2 ++ .../syntaxTests/parsing/contract_named_transient.sol | 2 ++ .../storageLayoutSpecifier/contract_named_at.sol | 1 + .../storageLayoutSpecifier/contract_named_layout.sol | 1 + .../contract_with_members_named_layout_and_at.sol | 2 ++ .../storageLayoutSpecifier/hex_string_cast.sol | 1 + .../syntaxTests/storageLayoutSpecifier/literal_cast.sol | 1 + .../syntaxTests/storageLayoutSpecifier/type_uint_max.sol | 1 + .../libsolidity/syntaxTests/unusedVariables/try_catch.sol | 1 + .../syntaxTests/variableDeclaration/illegal_names.sol | 6 ++++++ .../variableDeclaration/transient_as_identifier.sol | 8 ++++++++ 35 files changed, 72 insertions(+) diff --git a/test/libsolidity/syntaxTests/constants/constant_state_variable_named_transient.sol b/test/libsolidity/syntaxTests/constants/constant_state_variable_named_transient.sol index 4d9873d36d07..8c037e692dd7 100644 --- a/test/libsolidity/syntaxTests/constants/constant_state_variable_named_transient.sol +++ b/test/libsolidity/syntaxTests/constants/constant_state_variable_named_transient.sol @@ -2,3 +2,4 @@ contract C { int constant public transient = 0; } // ---- +// Warning 6335: (17-50): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. diff --git a/test/libsolidity/syntaxTests/dataLocations/data_location_in_function_type_fail.sol b/test/libsolidity/syntaxTests/dataLocations/data_location_in_function_type_fail.sol index cd46b15b0716..08f783aaf087 100644 --- a/test/libsolidity/syntaxTests/dataLocations/data_location_in_function_type_fail.sol +++ b/test/libsolidity/syntaxTests/dataLocations/data_location_in_function_type_fail.sol @@ -7,5 +7,6 @@ library L { // ---- // Warning 6162: (251-267): Naming function type parameters is deprecated. +// Warning 6335: (251-267): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. // TypeError 6651: (159-173): Data location must be "memory" or "calldata" for parameter in function, but "storage" was given. // TypeError 6651: (251-267): Data location must be "memory" or "calldata" for parameter in function, but none was given. diff --git a/test/libsolidity/syntaxTests/dataLocations/externalFunction/function_argument_location_specifier_test_external_transient.sol b/test/libsolidity/syntaxTests/dataLocations/externalFunction/function_argument_location_specifier_test_external_transient.sol index 98fbb2d5ee66..93b701558d05 100644 --- a/test/libsolidity/syntaxTests/dataLocations/externalFunction/function_argument_location_specifier_test_external_transient.sol +++ b/test/libsolidity/syntaxTests/dataLocations/externalFunction/function_argument_location_specifier_test_external_transient.sol @@ -2,4 +2,5 @@ contract test { function f(bytes transient) external; } // ---- +// Warning 6335: (31-46): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. // TypeError 6651: (31-46): Data location must be "memory" or "calldata" for parameter in external function, but none was given. diff --git a/test/libsolidity/syntaxTests/dataLocations/internalFunction/function_argument_location_specifier_test_internal_transient.sol b/test/libsolidity/syntaxTests/dataLocations/internalFunction/function_argument_location_specifier_test_internal_transient.sol index 4a5b6f999d86..61970ed1b4b9 100644 --- a/test/libsolidity/syntaxTests/dataLocations/internalFunction/function_argument_location_specifier_test_internal_transient.sol +++ b/test/libsolidity/syntaxTests/dataLocations/internalFunction/function_argument_location_specifier_test_internal_transient.sol @@ -2,4 +2,5 @@ contract test { function f(bytes transient) internal {} } // ---- +// Warning 6335: (31-46): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. // TypeError 6651: (31-46): Data location must be "storage", "memory" or "calldata" for parameter in function, but none was given. diff --git a/test/libsolidity/syntaxTests/dataLocations/libraries/library_function_with_data_location_transient.sol b/test/libsolidity/syntaxTests/dataLocations/libraries/library_function_with_data_location_transient.sol index 75253342c4e0..14252383987d 100644 --- a/test/libsolidity/syntaxTests/dataLocations/libraries/library_function_with_data_location_transient.sol +++ b/test/libsolidity/syntaxTests/dataLocations/libraries/library_function_with_data_location_transient.sol @@ -9,6 +9,14 @@ library L { function i2() external pure returns (uint[] transient) { } } // ---- +// Warning 6335: (28-44): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (103-119): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (141-157): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (218-234): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (256-272): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (329-345): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (367-383): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (444-460): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. // TypeError 6651: (28-44): Data location must be "storage", "memory" or "calldata" for parameter in function, but none was given. // TypeError 6651: (103-119): Data location must be "storage", "memory" or "calldata" for return parameter in function, but none was given. // TypeError 6651: (141-157): Data location must be "storage", "memory" or "calldata" for parameter in function, but none was given. diff --git a/test/libsolidity/syntaxTests/dataLocations/libraryExternalFunction/function_argument_location_specifier_test_external_transient.sol b/test/libsolidity/syntaxTests/dataLocations/libraryExternalFunction/function_argument_location_specifier_test_external_transient.sol index 1dcedf49adcf..bd720d0bfede 100644 --- a/test/libsolidity/syntaxTests/dataLocations/libraryExternalFunction/function_argument_location_specifier_test_external_transient.sol +++ b/test/libsolidity/syntaxTests/dataLocations/libraryExternalFunction/function_argument_location_specifier_test_external_transient.sol @@ -2,4 +2,5 @@ library test { function f(bytes transient) external {} } // ---- +// Warning 6335: (30-45): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. // TypeError 6651: (30-45): Data location must be "storage", "memory" or "calldata" for parameter in external function, but none was given. diff --git a/test/libsolidity/syntaxTests/dataLocations/libraryInternalFunction/function_argument_location_specifier_test_internal_transient.sol b/test/libsolidity/syntaxTests/dataLocations/libraryInternalFunction/function_argument_location_specifier_test_internal_transient.sol index d66fa7fadd2d..976fd170b221 100644 --- a/test/libsolidity/syntaxTests/dataLocations/libraryInternalFunction/function_argument_location_specifier_test_internal_transient.sol +++ b/test/libsolidity/syntaxTests/dataLocations/libraryInternalFunction/function_argument_location_specifier_test_internal_transient.sol @@ -2,4 +2,5 @@ library test { function f(bytes transient) internal pure {} } // ---- +// Warning 6335: (30-45): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. // TypeError 6651: (30-45): Data location must be "storage", "memory" or "calldata" for parameter in function, but none was given. diff --git a/test/libsolidity/syntaxTests/dataLocations/privateFunction/private_function_parameters_location_transient.sol b/test/libsolidity/syntaxTests/dataLocations/privateFunction/private_function_parameters_location_transient.sol index 750aa4fee522..0ef17525de65 100644 --- a/test/libsolidity/syntaxTests/dataLocations/privateFunction/private_function_parameters_location_transient.sol +++ b/test/libsolidity/syntaxTests/dataLocations/privateFunction/private_function_parameters_location_transient.sol @@ -2,4 +2,5 @@ contract C { function f(uint[] transient) private pure {} } // ---- +// Warning 6335: (28-44): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. // TypeError 6651: (28-44): Data location must be "storage", "memory" or "calldata" for parameter in function, but none was given. diff --git a/test/libsolidity/syntaxTests/dataLocations/privateFunction/private_function_return_parameters_location_transient.sol b/test/libsolidity/syntaxTests/dataLocations/privateFunction/private_function_return_parameters_location_transient.sol index d1bf8762480f..fa8d5f69757c 100644 --- a/test/libsolidity/syntaxTests/dataLocations/privateFunction/private_function_return_parameters_location_transient.sol +++ b/test/libsolidity/syntaxTests/dataLocations/privateFunction/private_function_return_parameters_location_transient.sol @@ -2,4 +2,5 @@ contract C { function f() private pure returns (uint[] transient) {} } // ---- +// Warning 6335: (52-68): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. // TypeError 6651: (52-68): Data location must be "storage", "memory" or "calldata" for return parameter in function, but none was given. diff --git a/test/libsolidity/syntaxTests/dataLocations/publicFunction/function_argument_location_specifier_test_public_transient.sol b/test/libsolidity/syntaxTests/dataLocations/publicFunction/function_argument_location_specifier_test_public_transient.sol index ce4f42f469e4..c8e7fdf44388 100644 --- a/test/libsolidity/syntaxTests/dataLocations/publicFunction/function_argument_location_specifier_test_public_transient.sol +++ b/test/libsolidity/syntaxTests/dataLocations/publicFunction/function_argument_location_specifier_test_public_transient.sol @@ -2,4 +2,5 @@ contract test { function f(bytes transient) public; } // ---- +// Warning 6335: (31-46): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. // TypeError 6651: (31-46): Data location must be "memory" or "calldata" for parameter in function, but none was given. diff --git a/test/libsolidity/syntaxTests/dataLocations/publicFunction/public_function_return_parameters_location_transient.sol b/test/libsolidity/syntaxTests/dataLocations/publicFunction/public_function_return_parameters_location_transient.sol index 862b7d236bfa..41b6ba47b1cc 100644 --- a/test/libsolidity/syntaxTests/dataLocations/publicFunction/public_function_return_parameters_location_transient.sol +++ b/test/libsolidity/syntaxTests/dataLocations/publicFunction/public_function_return_parameters_location_transient.sol @@ -2,4 +2,5 @@ contract C { function h() public pure returns(uint[] transient) {} } // ---- +// Warning 6335: (50-66): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. // TypeError 6651: (50-66): Data location must be "memory" or "calldata" for return parameter in function, but none was given. diff --git a/test/libsolidity/syntaxTests/dataLocations/transient_function_type_parameter.sol b/test/libsolidity/syntaxTests/dataLocations/transient_function_type_parameter.sol index 04f20e85c050..b34f2e92286a 100644 --- a/test/libsolidity/syntaxTests/dataLocations/transient_function_type_parameter.sol +++ b/test/libsolidity/syntaxTests/dataLocations/transient_function_type_parameter.sol @@ -3,3 +3,4 @@ contract C { } // ---- // Warning 6162: (27-41): Naming function type parameters is deprecated. +// Warning 6335: (27-41): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. diff --git a/test/libsolidity/syntaxTests/duplicateFunctions/illegal_names_exception.sol b/test/libsolidity/syntaxTests/duplicateFunctions/illegal_names_exception.sol index e7541fe233d4..84f620b71b8b 100644 --- a/test/libsolidity/syntaxTests/duplicateFunctions/illegal_names_exception.sol +++ b/test/libsolidity/syntaxTests/duplicateFunctions/illegal_names_exception.sol @@ -8,5 +8,7 @@ contract C { } } // ---- +// Warning 6335: (61-88): "this" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (90-118): "super" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. // Warning 2319: (61-88): This declaration shadows a builtin symbol. // Warning 2319: (90-118): This declaration shadows a builtin symbol. diff --git a/test/libsolidity/syntaxTests/duplicateFunctions/illegal_names_functions.sol b/test/libsolidity/syntaxTests/duplicateFunctions/illegal_names_functions.sol index e6c7134850f6..5a42d229367c 100644 --- a/test/libsolidity/syntaxTests/duplicateFunctions/illegal_names_functions.sol +++ b/test/libsolidity/syntaxTests/duplicateFunctions/illegal_names_functions.sol @@ -10,6 +10,8 @@ contract C { } } // ---- +// Warning 6335: (84-117): "super" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (123-155): "this" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. // DeclarationError 3726: (17-78): The name "_" is reserved. // DeclarationError 3726: (84-117): The name "super" is reserved. // DeclarationError 3726: (123-155): The name "this" is reserved. diff --git a/test/libsolidity/syntaxTests/enums/illegal_names.sol b/test/libsolidity/syntaxTests/enums/illegal_names.sol index 399d91ed1252..10d7b03623c1 100644 --- a/test/libsolidity/syntaxTests/enums/illegal_names.sol +++ b/test/libsolidity/syntaxTests/enums/illegal_names.sol @@ -21,6 +21,10 @@ contract C { E e; } // ---- +// Warning 6335: (0-19): "this" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (20-40): "super" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (72-76): "this" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (82-87): "super" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. // DeclarationError 3726: (0-19): The name "this" is reserved. // DeclarationError 3726: (20-40): The name "super" is reserved. // DeclarationError 3726: (41-57): The name "_" is reserved. diff --git a/test/libsolidity/syntaxTests/events/illegal_names_exception.sol b/test/libsolidity/syntaxTests/events/illegal_names_exception.sol index c45db8d7d123..c72f0189ee1c 100644 --- a/test/libsolidity/syntaxTests/events/illegal_names_exception.sol +++ b/test/libsolidity/syntaxTests/events/illegal_names_exception.sol @@ -5,5 +5,7 @@ contract C { event _(); } // ---- +// Warning 6335: (80-93): "this" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (95-109): "super" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. // Warning 2319: (80-93): This declaration shadows a builtin symbol. // Warning 2319: (95-109): This declaration shadows a builtin symbol. diff --git a/test/libsolidity/syntaxTests/events/illegal_names_exception_file_level.sol b/test/libsolidity/syntaxTests/events/illegal_names_exception_file_level.sol index 48b23dc38fb6..acdeb9979148 100644 --- a/test/libsolidity/syntaxTests/events/illegal_names_exception_file_level.sol +++ b/test/libsolidity/syntaxTests/events/illegal_names_exception_file_level.sol @@ -2,3 +2,6 @@ event this(); event super(); event _(); +// ---- +// Warning 6335: (66-79): "this" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (80-94): "super" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. diff --git a/test/libsolidity/syntaxTests/freeFunctions/illegal_names.sol b/test/libsolidity/syntaxTests/freeFunctions/illegal_names.sol index aed22b225b61..3aa7ae9427bb 100644 --- a/test/libsolidity/syntaxTests/freeFunctions/illegal_names.sol +++ b/test/libsolidity/syntaxTests/freeFunctions/illegal_names.sol @@ -10,6 +10,8 @@ contract C { } } // ---- +// Warning 6335: (0-18): "this" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (19-38): "super" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. // DeclarationError 3726: (0-18): The name "this" is reserved. // DeclarationError 3726: (19-38): The name "super" is reserved. // DeclarationError 3726: (39-54): The name "_" is reserved. diff --git a/test/libsolidity/syntaxTests/functionTypes/function_type_with_transient_param.sol b/test/libsolidity/syntaxTests/functionTypes/function_type_with_transient_param.sol index b38e37177ea1..ce242db98b92 100644 --- a/test/libsolidity/syntaxTests/functionTypes/function_type_with_transient_param.sol +++ b/test/libsolidity/syntaxTests/functionTypes/function_type_with_transient_param.sol @@ -4,5 +4,7 @@ contract C { } // ---- // Warning 6162: (27-41): Naming function type parameters is deprecated. +// Warning 6335: (27-41): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. // Warning 6162: (69-85): Naming function type parameters is deprecated. +// Warning 6335: (69-85): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. // TypeError 6651: (69-85): Data location must be "memory" or "calldata" for parameter in function, but none was given. diff --git a/test/libsolidity/syntaxTests/immutable/illegal_names.sol b/test/libsolidity/syntaxTests/immutable/illegal_names.sol index a80083ed8ba5..2fcf2821a105 100644 --- a/test/libsolidity/syntaxTests/immutable/illegal_names.sol +++ b/test/libsolidity/syntaxTests/immutable/illegal_names.sol @@ -4,6 +4,8 @@ contract C { uint immutable this; } // ---- +// Warning 6335: (17-37): "super" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (65-84): "this" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. // DeclarationError 3726: (17-37): The name "super" is reserved. // DeclarationError 3726: (43-59): The name "_" is reserved. // DeclarationError 3726: (65-84): The name "this" is reserved. diff --git a/test/libsolidity/syntaxTests/immutable/immutable_state_var_named_transient.sol b/test/libsolidity/syntaxTests/immutable/immutable_state_var_named_transient.sol index c0ac3a8abb3c..eb55acd8531d 100644 --- a/test/libsolidity/syntaxTests/immutable/immutable_state_var_named_transient.sol +++ b/test/libsolidity/syntaxTests/immutable/immutable_state_var_named_transient.sol @@ -2,3 +2,4 @@ contract C { address public immutable transient; } // ---- +// Warning 6335: (17-51): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. diff --git a/test/libsolidity/syntaxTests/modifiers/transient_parameter.sol b/test/libsolidity/syntaxTests/modifiers/transient_parameter.sol index be90ca54dc39..03f958f72cd1 100644 --- a/test/libsolidity/syntaxTests/modifiers/transient_parameter.sol +++ b/test/libsolidity/syntaxTests/modifiers/transient_parameter.sol @@ -2,4 +2,5 @@ contract A { modifier mod2(uint[] transient) { _; } } // ---- +// Warning 6335: (31-47): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. // TypeError 6651: (31-47): Data location must be "storage", "memory" or "calldata" for parameter in function, but none was given. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/shadowsBuiltin/illegal_names_function_parameters.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/shadowsBuiltin/illegal_names_function_parameters.sol index 6b5c7c99bbe7..f7313003a7e8 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/shadowsBuiltin/illegal_names_function_parameters.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/shadowsBuiltin/illegal_names_function_parameters.sol @@ -16,6 +16,10 @@ contract C { } } // ---- +// Warning 6335: (28-38): "super" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (70-79): "this" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (167-177): "super" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (238-247): "this" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. // DeclarationError 3726: (28-38): The name "super" is reserved. // DeclarationError 3726: (70-79): The name "this" is reserved. // DeclarationError 3726: (111-117): The name "_" is reserved. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/shadowsBuiltin/illegal_names_library_using_for.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/shadowsBuiltin/illegal_names_library_using_for.sol index ac928fa9f493..8cc616ec9c93 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/shadowsBuiltin/illegal_names_library_using_for.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/shadowsBuiltin/illegal_names_library_using_for.sol @@ -19,6 +19,8 @@ contract C { using _ for int; } // ---- +// Warning 6335: (0-49): "super" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (51-99): "this" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. // DeclarationError 3726: (0-49): The name "super" is reserved. // DeclarationError 3726: (51-99): The name "this" is reserved. // DeclarationError 3726: (100-145): The name "_" is reserved. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/shadowsBuiltin/this_super.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/shadowsBuiltin/this_super.sol index 47970c046111..1088834b5e14 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/shadowsBuiltin/this_super.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/shadowsBuiltin/this_super.sol @@ -5,6 +5,8 @@ contract C { } } // ---- +// Warning 6335: (52-62): "super" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (76-85): "this" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. // DeclarationError 3726: (52-62): The name "super" is reserved. // DeclarationError 3726: (76-85): The name "this" is reserved. // Warning 2319: (52-62): This declaration shadows a builtin symbol. diff --git a/test/libsolidity/syntaxTests/parsing/contract_named_transient.sol b/test/libsolidity/syntaxTests/parsing/contract_named_transient.sol index 853396f21bb5..257c8bcbba23 100644 --- a/test/libsolidity/syntaxTests/parsing/contract_named_transient.sol +++ b/test/libsolidity/syntaxTests/parsing/contract_named_transient.sol @@ -1 +1,3 @@ contract transient {} +// ---- +// Warning 6335: (0-21): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. diff --git a/test/libsolidity/syntaxTests/storageLayoutSpecifier/contract_named_at.sol b/test/libsolidity/syntaxTests/storageLayoutSpecifier/contract_named_at.sol index c5127249ab68..17f6c9e6908f 100644 --- a/test/libsolidity/syntaxTests/storageLayoutSpecifier/contract_named_at.sol +++ b/test/libsolidity/syntaxTests/storageLayoutSpecifier/contract_named_at.sol @@ -1,2 +1,3 @@ contract at layout at 0x1234ABC { } // ---- +// Warning 6335: (0-35): "at" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. diff --git a/test/libsolidity/syntaxTests/storageLayoutSpecifier/contract_named_layout.sol b/test/libsolidity/syntaxTests/storageLayoutSpecifier/contract_named_layout.sol index 111a4fc365f8..08b5fe74c8bd 100644 --- a/test/libsolidity/syntaxTests/storageLayoutSpecifier/contract_named_layout.sol +++ b/test/libsolidity/syntaxTests/storageLayoutSpecifier/contract_named_layout.sol @@ -1,2 +1,3 @@ contract layout layout at 0x1234ABC { } // ---- +// Warning 6335: (0-39): "layout" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. diff --git a/test/libsolidity/syntaxTests/storageLayoutSpecifier/contract_with_members_named_layout_and_at.sol b/test/libsolidity/syntaxTests/storageLayoutSpecifier/contract_with_members_named_layout_and_at.sol index 7e448bba7fd5..fe35c685ee46 100644 --- a/test/libsolidity/syntaxTests/storageLayoutSpecifier/contract_with_members_named_layout_and_at.sol +++ b/test/libsolidity/syntaxTests/storageLayoutSpecifier/contract_with_members_named_layout_and_at.sol @@ -3,3 +3,5 @@ contract C layout at 0x1234 { function at() public pure { } } // ---- +// Warning 6335: (34-45): "layout" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (51-80): "at" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. diff --git a/test/libsolidity/syntaxTests/storageLayoutSpecifier/hex_string_cast.sol b/test/libsolidity/syntaxTests/storageLayoutSpecifier/hex_string_cast.sol index a803d005f7dd..9b86f52941a6 100644 --- a/test/libsolidity/syntaxTests/storageLayoutSpecifier/hex_string_cast.sol +++ b/test/libsolidity/syntaxTests/storageLayoutSpecifier/hex_string_cast.sol @@ -1,3 +1,4 @@ contract at layout at uint40(bytes5(hex"0011223344")) { } // ---- +// Warning 6335: (0-57): "at" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. // TypeError 6396: (22-53): The base slot of the storage layout must evaluate to a rational number. diff --git a/test/libsolidity/syntaxTests/storageLayoutSpecifier/literal_cast.sol b/test/libsolidity/syntaxTests/storageLayoutSpecifier/literal_cast.sol index 0f682d779b0b..54f8c3ca5676 100644 --- a/test/libsolidity/syntaxTests/storageLayoutSpecifier/literal_cast.sol +++ b/test/libsolidity/syntaxTests/storageLayoutSpecifier/literal_cast.sol @@ -1,3 +1,4 @@ contract at layout at uint(42) { } // ---- +// Warning 6335: (0-34): "at" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. // TypeError 6396: (22-30): The base slot of the storage layout must evaluate to a rational number. diff --git a/test/libsolidity/syntaxTests/storageLayoutSpecifier/type_uint_max.sol b/test/libsolidity/syntaxTests/storageLayoutSpecifier/type_uint_max.sol index dd8ee6f9cc27..d36534a0c232 100644 --- a/test/libsolidity/syntaxTests/storageLayoutSpecifier/type_uint_max.sol +++ b/test/libsolidity/syntaxTests/storageLayoutSpecifier/type_uint_max.sol @@ -1,3 +1,4 @@ contract at layout at type(uint).max { } // ---- +// Warning 6335: (0-40): "at" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. // TypeError 6396: (22-36): The base slot of the storage layout must evaluate to a rational number. diff --git a/test/libsolidity/syntaxTests/unusedVariables/try_catch.sol b/test/libsolidity/syntaxTests/unusedVariables/try_catch.sol index 0376c3e13e31..6ca1626f1dee 100644 --- a/test/libsolidity/syntaxTests/unusedVariables/try_catch.sol +++ b/test/libsolidity/syntaxTests/unusedVariables/try_catch.sol @@ -12,6 +12,7 @@ contract test { // ==== // EVMVersion: >=byzantium // ---- +// Warning 6335: (165-183): "error" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. // Warning 5667: (49-55): Unused function parameter. Remove or comment out the variable name to silence this warning. // Warning 5667: (89-95): Unused try/catch parameter. Remove or comment out the variable name to silence this warning. // Warning 5667: (122-143): Unused try/catch parameter. Remove or comment out the variable name to silence this warning. diff --git a/test/libsolidity/syntaxTests/variableDeclaration/illegal_names.sol b/test/libsolidity/syntaxTests/variableDeclaration/illegal_names.sol index 24d1d98d6e67..8dba1dac08b4 100644 --- a/test/libsolidity/syntaxTests/variableDeclaration/illegal_names.sol +++ b/test/libsolidity/syntaxTests/variableDeclaration/illegal_names.sol @@ -12,6 +12,12 @@ contract D { struct _ { uint super; } } // ---- +// Warning 6335: (0-22): "this" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (24-47): "super" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (84-96): "this" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (99-108): "super" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (160-174): "this" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (188-198): "super" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. // DeclarationError 3726: (0-22): The name "this" is reserved. // DeclarationError 3726: (24-47): The name "super" is reserved. // DeclarationError 3726: (49-68): The name "_" is reserved. diff --git a/test/libsolidity/syntaxTests/variableDeclaration/transient_as_identifier.sol b/test/libsolidity/syntaxTests/variableDeclaration/transient_as_identifier.sol index ced189faf061..e1dc51fa1dd5 100644 --- a/test/libsolidity/syntaxTests/variableDeclaration/transient_as_identifier.sol +++ b/test/libsolidity/syntaxTests/variableDeclaration/transient_as_identifier.sol @@ -23,3 +23,11 @@ contract D { } } // ---- +// Warning 6335: (17-53): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (75-89): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (101-115): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (127-149): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (168-181): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (253-267): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (321-334): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (368-385): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. From 586c3cacb721a6a2923dd98b1db6596226d2364c Mon Sep 17 00:00:00 2001 From: Matheus Aguiar Date: Wed, 24 Sep 2025 16:35:49 -0300 Subject: [PATCH 3/3] Update tested docs examples --- docs/assembly.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/assembly.rst b/docs/assembly.rst index 3f00ab6a8a79..45ab1c04e2b8 100644 --- a/docs/assembly.rst +++ b/docs/assembly.rst @@ -46,6 +46,7 @@ Solidity language without a compiler change. pragma solidity >=0.4.16 <0.9.0; library GetCode { + // This will report a warning - at you will be promoted to reserved keyword function at(address addr) public view returns (bytes memory code) { assembly { // retrieve the size of the code, this needs assembly