Actions
Bug #20091
closedAnonymous block method parameters no longer usable within blocks with ruby 3.3
    Bug #20091:
    Anonymous block method parameters no longer usable within blocks with ruby 3.3
  
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [amd64-freebsd13]
Description
This used to work on 3.1 and 3.2, but now fails with "anonymous block parameter is also used within block (SyntaxError)":
def g = yield
def f(&)
  g { g(&) }
end
p f { 123 }
And something like this also fails:
def f(&)
  loop do
    return g(&)
  end
end
        
           Updated by nobu (Nobuyoshi Nakada) almost 2 years ago
          Updated by nobu (Nobuyoshi Nakada) almost 2 years ago
          
          
        
        
      
      - Is duplicate of Bug #20090: Anonymous arguments are now syntax errors in unambiguous cases added
        
           Updated by nobu (Nobuyoshi Nakada) almost 2 years ago
          Updated by nobu (Nobuyoshi Nakada) almost 2 years ago
          
          
        
        
      
      - Status changed from Open to Closed
Actions