From 0ddf12b43faef5838d37cb3154073981fa7bcac0 Mon Sep 17 00:00:00 2001 From: Oskar Eichler <62393985+OskarEichler@users.noreply.github.com> Date: Sun, 30 Aug 2026 06:33:32 +0200 Subject: [PATCH] Scope non-simple method type assertions --- lib/rbs/unit_test/type_assertions.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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