diff --git a/CMakeLists.txt b/CMakeLists.txt index f4d67e243bab..5792563eb3c0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,7 +21,7 @@ include(EthPolicy) eth_policy() # project name and version should be set after cmake_policy CMP0048 -set(PROJECT_VERSION "0.8.32") +set(PROJECT_VERSION "0.8.33") # OSX target needed in order to support std::visit set(CMAKE_OSX_DEPLOYMENT_TARGET "10.14") project(solidity VERSION ${PROJECT_VERSION} LANGUAGES C CXX) diff --git a/Changelog.md b/Changelog.md index 93edad52899a..f556c98d2125 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,9 @@ +### 0.8.33 (2025-12-18) + +Bugfixes: +* TypeChecker: Fix internal error when accessing getters of constant variables. + + ### 0.8.32 (2025-12-18) Important Bugfixes: diff --git a/docs/bugs_by_version.json b/docs/bugs_by_version.json index 5282948776c2..d185171ec576 100644 --- a/docs/bugs_by_version.json +++ b/docs/bugs_by_version.json @@ -2081,6 +2081,10 @@ "bugs": [], "released": "2025-12-18" }, + "0.8.33": { + "bugs": [], + "released": "2025-12-18" + }, "0.8.4": { "bugs": [ "UnsoundSpillInMutualRecursion", diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index 656f7514a409..4d8967aae859 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -3456,16 +3456,6 @@ bool TypeChecker::visit(MemberAccess const& _memberAccess) if (!annotation.isPure.set()) annotation.isPure = false; - if ( - auto const* funcType = dynamic_cast(annotation.type); - funcType && - funcType->kind() != FunctionType::Kind::Declaration && - funcType->kind() != FunctionType::Kind::Internal && - funcType->kind() != FunctionType::Kind::Error && - funcType->kind() != FunctionType::Kind::Event - ) - solAssert(funcType->isPure() == *annotation.isPure); - return false; } diff --git a/test/libsolidity/syntaxTests/constants/access_via_getter.sol b/test/libsolidity/syntaxTests/constants/access_via_getter.sol new file mode 100644 index 000000000000..686c5a03927e --- /dev/null +++ b/test/libsolidity/syntaxTests/constants/access_via_getter.sol @@ -0,0 +1,8 @@ +contract Counter { + uint256 public constant MIN_LIQUIDITY = 1000; + + function run() view public { + this.MIN_LIQUIDITY(); + } +} +// ---- diff --git a/test/libsolidity/syntaxTests/immutable/access_via_getter.sol b/test/libsolidity/syntaxTests/immutable/access_via_getter.sol new file mode 100644 index 000000000000..6ce9e42c4301 --- /dev/null +++ b/test/libsolidity/syntaxTests/immutable/access_via_getter.sol @@ -0,0 +1,8 @@ +contract Counter { + uint256 public immutable MIN_LIQUIDITY = 1000; + + function run() view public { + this.MIN_LIQUIDITY(); + } +} +// ----