From: mame@... Date: 2020-12-17T00:49:43+00:00 Subject: [ruby-core:101482] [Ruby master Bug#17398] SyntaxError in endless method Issue #17398 has been updated by mame (Yusuke Endoh). The body of an endless method must be an expression (called "arg" in the syntax rules of parse.y). `puts("bar")` is an expression, but `puts "bar"` is a statement (called "command" in the syntax rules). I think it could be a bit confusing, but I have no idea whether we can/should allow a statement as a body of an endless method. ---------------------------------------- Bug #17398: SyntaxError in endless method https://bugs.ruby-lang.org/issues/17398#change-89261 * Author: zverok (Victor Shepelev) * Status: Open * Priority: Normal * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN ---------------------------------------- This works: ```ruby def foo() = puts("bar") ``` This does not: ```ruby def foo() = puts "bar" # ^ syntax error, unexpected string literal, expecting `do' or '{' or '(' ``` Is this intentional or accidental? Not sure how it is reasoned. -- https://bugs.ruby-lang.org/ Unsubscribe: