From: "kddnewton (Kevin Newton) via ruby-core" Date: 2024-09-17T23:37:25+00:00 Subject: [ruby-core:119243] [Ruby master Bug#20751] Regression in Prism related to use of return in default argument values Issue #20751 has been updated by kddnewton (Kevin Newton). I believe this was fixed this morning. Could you double-check that this is still an issue? ---------------------------------------- Bug #20751: Regression in Prism related to use of return in default argument values https://bugs.ruby-lang.org/issues/20751#change-109825 * Author: jeremyevans0 (Jeremy Evans) * Status: Open * Backport: 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONTNEED ---------------------------------------- All versions of parse.y dating at least back to Ruby 1.8.7, and Prism in both Ruby 3.3.5 and 3.4.0preview1, correctly parses this code: ```ruby class A def foo(b = nil || (return)) end end ``` The master branch, unless `--parser=parse.y` is used, now considers this a SyntaxError: ``` -: -:2: syntax error found (SyntaxError) 1 | class A > 2 | def foo(b = nil || (return)) | ^~~~~~ Invalid return in class/module body 3 | end 4 | end ``` -- 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/