Permalink
Browse files

Implement validation for "is rw"

  • Loading branch information...
1 parent a2b2f37 commit 622e5dc09a866c5c0ce147147e60d27ad874a923 @sorear committed May 16, 2011
Showing with 4 additions and 2 deletions.
  1. +1 −2 lib/Kernel.cs
  2. +3 −0 test2.pl
View
@@ -409,8 +409,7 @@ public class SubInfo {
// XXX $_ stupidity
if (rw && !src.rw)
- rw = false;
- //return Kernel.Die(th, "Binding " + PName(rbase) + ", cannot bind read-only value to is rw parameter");
+ return Kernel.Die(th, "Binding " + PName(rbase) + ", cannot bind read-only value to is rw parameter");
// fast path
if (rw == src.rw && islist == src.islist) {
if (!src.type.HasMRO(type)) {
View
@@ -157,6 +157,9 @@
{
is $_, 5, '$_ passes into bare blocks';
}
+
+ sub foo($x is rw) { $x }
+ dies_ok { foo 5 }, "cannot rw-bind constant";
}
#is $?FILE, 'test.pl', '$?FILE works';

0 comments on commit 622e5dc

Please sign in to comment.