Skip to content

Commit 25fff99

Browse files
authored
Merge pull request #3139 from OskarEichler/codex/scoped-type-assertions
Restore scoped non-simple method type assertions
2 parents 716ca05 + f666f0b commit 25fff99

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

lib/rbs/unit_test/type_assertions.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,11 +354,12 @@ def assert_type(type, value)
354354
end
355355

356356
def allow_non_simple_method_type()
357+
previous = @allows_non_simple_method_type
357358
begin
358359
@allows_non_simple_method_type = true
359360
yield
360-
rescue
361-
@allows_non_simple_method_type = false
361+
ensure
362+
@allows_non_simple_method_type = previous
362363
end
363364
end
364365

0 commit comments

Comments
 (0)