From: Yukihiro Matsumoto Date: 2005-03-11T03:26:24+09:00 Subject: Re: proc and block local variables causes a [BUG] Hi, In message "Re: proc and block local variables causes a [BUG]" on Fri, 11 Mar 2005 00:20:23 +0900, URABE Shyouhei writes: |Maybe I just don't understand what is happening to the CVS but... | |% ruby -e'1.times {|i; j=i| p[i, j] }' |[0,0] |% ruby -e'{|i; j=i| p [i, j]}.call(0)' |-e:1: [BUG] bug in variable assignment |ruby-1.9.0 (2005-03-10) [powerpc-darwin7.7.0] It is a bug. Thank you for reporting. matz. Index: parse.y =================================================================== RCS file: /var/cvs/src/ruby/parse.y,v retrieving revision 1.373 diff -p -u -1 -r1.373 parse.y --- parse.y 9 Mar 2005 09:29:51 -0000 1.373 +++ parse.y 10 Mar 2005 18:25:51 -0000 @@ -2540,3 +2540,6 @@ primary : literal /*%%%*/ - $$ = NEW_LAMBDA($3, dyna_init($5, $4)); + $3->nd_body = block_append($3->nd_body, + dyna_init($5, $4)); + $$ = $3; + nd_set_type($3, NODE_LAMBDA); nd_set_line($$, $1);