From: "Earlopain (A S) via ruby-core" Date: 2024-08-17T09:57:12+00:00 Subject: [ruby-core:118866] [Ruby master Bug#20680] No "void context" warning for literals/etc. in ensure block Issue #20680 has been reported by Earlopain (A S). ---------------------------------------- Bug #20680: No "void context" warning for literals/etc. in ensure block https://bugs.ruby-lang.org/issues/20680 * Author: Earlopain (A S) * Status: Open * ruby -v: 3.3.4 * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- Providing this code, I would expect ruby to emit a void context warning: ```rb begin foo rescue bar ensure 42 end ``` `ensure` blocks don't return a value unless `return` is used explicitly. Am I right in my assumption that this should theoretically emit a warning? -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/