Project

General

Profile

Actions

Bug #21661

open

Endless method definition as a default value of block parameter is wrongly accepted in Prism

Bug #21661: Endless method definition as a default value of block parameter is wrongly accepted in Prism

Added by tompng (tomoya ishida) about 17 hours ago.

Status:
Open
Assignee:
Target version:
-
ruby -v:
ruby 3.5.0dev (2025-11-01T00:18:01Z master 17a7b4e031) +PRISM [x86_64-linux]
[ruby-core:123632]

Description

These are syntax error in parse.y but not in Prism.

p do |a = def f = 1; b| end
p do |a = def f = 1| 2; b|c end # `|` inside block parameter

Normal assignment as a default value p do |a = b = 1| end is already syntax error.

No data to display

Actions

Also available in: PDF Atom