Closed p5pRT closed 19 years ago
Builtin attributes are parsed but ignored on subroutine declarations\, for example:
$ perl -e 'sub foo : lvalue ; foo = 7; sub foo : lvalue { $a }' Can't modify non-lvalue subroutine call in scalar assignment at -e line 1\, near "7;" Execution of -e aborted due to compilation errors.
The patch attached solves the problem.
Cheers\,
- Salvador.
Salvador "FandiXXo" (via RT) wrote:
Builtin attributes are parsed but ignored on subroutine declarations\, for example:
$ perl -e 'sub foo : lvalue ; foo = 7; sub foo : lvalue { $a }' Can't modify non-lvalue subroutine call in scalar assignment at -e line 1\, near "7;" Execution of -e aborted due to compilation errors.
The patch attached solves the problem.
Thanks\, applied as #24851 to bleadperl.
The RT System itself - Status changed from 'new' to 'open'
@rgs - Status changed from 'open' to 'resolved'
just another small patch for a related bug: subs with builtin attributes shouldn't become constant subs\, for instance:
$ ./perl -e 'sub foo () : assertion { 7 } ; use assertions "1"; print foo; use assertions "0"; print foo' 77
CVf_BUILTIN_ATTRS)) const_sv = Nullsv; else const_sv = op_const_sv(block\, Nullcv);
--- Rafael Garcia-Suarez via RT \perlbug\-followup@​perl\.org wrote:
Salvador "FandiXXo" (via RT) wrote:
Builtin attributes are parsed but ignored on subroutine declarations\, for example:
$ perl -e 'sub foo : lvalue ; foo = 7; sub foo : lvalue { $a }' Can't modify non-lvalue subroutine call in scalar assignment at -e line 1\, near "7;" Execution of -e aborted due to compilation errors.
The patch attached solves the problem.
Thanks\, applied as #24851 to bleadperl.
__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Salvador "FandiXo" wrote:
just another small patch for a related bug: subs with builtin attributes shouldn't become constant subs\, for instance:
Thanks\, applied as change #24865 to bleadperl.
$ ./perl -e 'sub foo () : assertion { 7 } ; use assertions "1"; print foo; use assertions "0"; print foo'
Migrated from rt.perl.org#36297 (status was 'resolved')
Searchable as RT36297$