diff --git a/lib/rbs/unit_test/type_assertions.rb b/lib/rbs/unit_test/type_assertions.rb index 686fe1aea..72875960e 100644 --- a/lib/rbs/unit_test/type_assertions.rb +++ b/lib/rbs/unit_test/type_assertions.rb @@ -354,11 +354,12 @@ def assert_type(type, value) end def allow_non_simple_method_type() + previous = @allows_non_simple_method_type begin @allows_non_simple_method_type = true yield - rescue - @allows_non_simple_method_type = false + ensure + @allows_non_simple_method_type = previous end end