From: "kddnewton (Kevin Newton) via ruby-core" Date: 2026-11-21T19:30:10+00:00 Subject: [ruby-core:127664] [Ruby Bug#22619] parse.y missing invalid return syntax error Issue #22619 has been reported by kddnewton (Kevin Newton). ---------------------------------------- Bug #22619: parse.y missing invalid return syntax error https://bugs.ruby-lang.org/issues/22619 * Author: kddnewton (Kevin Newton) * Status: Open * Backport: 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN ---------------------------------------- ``` $ ./ruby --parser=parse.y -ce 'class C; return; end' -e:1: Invalid return in class/module body class C; return; end ./ruby: compile error (SyntaxError) $ ./ruby --parser=parse.y -ce 'class C; def f; end; return; end' Syntax OK ``` and ``` $ ./ruby --parser=parse.y -e 'class C; return; end' -e:1: Invalid return in class/module body class C; return; end ./ruby: compile error (SyntaxError) $ ./ruby --parser=parse.y -e 'class C; def f; end; return; end' -e:1:in '': unexpected return (LocalJumpError) from -e:1:in '
' ``` -- 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/