[svn:parrot] r35633 - trunk/languages/perl6/src/classes

[email protected]
Newsgroups perl.cvs.parrot
Message-ID <[email protected]>
Author: pmichaud
Date: Fri Jan 16 08:48:10 2009
New Revision: 35633

Modified:
   trunk/languages/perl6/src/classes/Signature.pir

Log:
[rakudo]:  Require arguments to &foo to be callable.


Modified: trunk/languages/perl6/src/classes/Signature.pir
==============================================================================
--- trunk/languages/perl6/src/classes/Signature.pir	(original)
+++ trunk/languages/perl6/src/classes/Signature.pir	Fri Jan 16 08:48:10 2009
@@ -287,6 +287,7 @@
     orig = callerlex[name]
     if sigil == '@' goto param_array
     if sigil == '%' goto param_hash
+    if sigil != '$' goto param_sub
     var = '!CALLMETHOD'('Scalar', orig)
     ##  typecheck the argument
     if null type goto param_val_done
@@ -330,6 +331,11 @@
     ## place the updated variable back into lex
     callerlex[name] = var
     goto param_loop
+  param_sub:
+    $I0 = isa orig, 'Sub'
+    unless $I0 goto err_sub
+    if $I0 goto param_loop
+    
   param_done:
   end:
     .return ()
@@ -343,6 +349,9 @@
     goto err_throw
   err_hash:
     errmsg = 'Non-Associative argument'
+    goto err_throw
+  err_sub:
+    errmsg = 'Non-Callable argument'
   err_throw:
     .local string callername
     callername = callersub
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.