From c6e73707c74f6067083fa5a4d7e9d8e758d0ba95 Mon Sep 17 00:00:00 2001 From: Saw-mon & Natalie <3140080+Saw-mon-and-Natalie@users.noreply.github.com> Date: Sun, 21 May 2023 16:59:40 +0100 Subject: [PATCH] fixed codestyle. --- libsolidity/analysis/TypeChecker.cpp | 3 ++- .../syntaxTests/types/struct/typehash_member_mapping.sol | 2 +- .../syntaxTests/types/struct/typehash_recursive_struct.sol | 4 ++-- .../syntaxTests/types/struct/typehash_recursive_struct_2.sol | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index 5ff6f18f1..760041d15 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -3398,7 +3398,8 @@ bool TypeChecker::visit(MemberAccess const& _memberAccess) auto accessedStructType = dynamic_cast(magicType->typeArgument()); solAssert(accessedStructType, "typehash requested on a non struct type."); - if (accessedStructType->recursive()) { + if (accessedStructType->recursive()) + { m_errorReporter.typeError( 9298_error, _memberAccess.location(), diff --git a/test/libsolidity/syntaxTests/types/struct/typehash_member_mapping.sol b/test/libsolidity/syntaxTests/types/struct/typehash_member_mapping.sol index 27dd775e6..8a876dec9 100644 --- a/test/libsolidity/syntaxTests/types/struct/typehash_member_mapping.sol +++ b/test/libsolidity/syntaxTests/types/struct/typehash_member_mapping.sol @@ -1,6 +1,6 @@ contract C { struct S { - mapping (uint256 => uint256) x; + mapping (uint256 => uint256) x; } bytes32 h = type(S).typehash; diff --git a/test/libsolidity/syntaxTests/types/struct/typehash_recursive_struct.sol b/test/libsolidity/syntaxTests/types/struct/typehash_recursive_struct.sol index 018411d8b..eddfc17df 100644 --- a/test/libsolidity/syntaxTests/types/struct/typehash_recursive_struct.sol +++ b/test/libsolidity/syntaxTests/types/struct/typehash_recursive_struct.sol @@ -1,6 +1,6 @@ contract C { - struct S { - S[] s; + struct S { + S[] s; } bytes32 h = type(S).typehash; diff --git a/test/libsolidity/syntaxTests/types/struct/typehash_recursive_struct_2.sol b/test/libsolidity/syntaxTests/types/struct/typehash_recursive_struct_2.sol index 9f46255ed..3ff539237 100644 --- a/test/libsolidity/syntaxTests/types/struct/typehash_recursive_struct_2.sol +++ b/test/libsolidity/syntaxTests/types/struct/typehash_recursive_struct_2.sol @@ -4,8 +4,8 @@ contract A { } } contract C { - struct S { - A.S s; + struct S { + A.S s; } bytes32 h = type(S).typehash;