From 33f948a476afe80cbb504278145daa595de7bb1b Mon Sep 17 00:00:00 2001 From: MontakOleg Date: Sat, 22 Jun 2024 15:38:14 +0300 Subject: [PATCH] AutoMockable: fix generating static reset func (#1336) - don't generate invalid code (see https://github.com/krzysztofzablocki/Sourcery/issues/1335) - use type's access level for generated reset() function --- Templates/Templates/AutoMockable.stencil | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Templates/Templates/AutoMockable.stencil b/Templates/Templates/AutoMockable.stencil index fb2a45ac5..e0758f7b3 100755 --- a/Templates/Templates/AutoMockable.stencil +++ b/Templates/Templates/AutoMockable.stencil @@ -384,9 +384,9 @@ import {{ import }} {% endfor %} {% if type.allMethods|static|count != 0 and type.allMethods|initializer|count != type.allMethods|static|count %} - static func reset() + {% call accessLevel type.accessLevel %}static func reset() { - {% for method in type.allMethods|static %} + {% for method in type.allMethods|static|!definedInExtension %} {% call resetMethod method %} {% endfor %} }