Actions
Bug #14062
closedTop-level return allows an argument
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.5.0dev (2017-10-26 trunk 60450) [x86_64-linux]
Backport:
Description
puts "Here"
return 42 # or :foo, or any value
ruby test.rb
Here
Should it be a SyntaxError, as mentioned in https://bugs.ruby-lang.org/issues/4840#note-24 ?
It seems confusing to accept it silently, as one could expect the exit code to be affected by it (that should not be the case imho).
Discovered in https://github.com/ruby/spec/pull/530
Files
Actions
Like0
Like0Like0Like0Like0Like0Like0Like0Like0