#1033: no args checking for a sub without params
--------------------+-------------------------------------------------------
 Reporter:  coke    |       Owner:       
     Type:  RFC     |      Status:  new  
 Priority:  normal  |   Milestone:       
Component:  none    |     Version:  trunk
 Severity:  medium  |    Keywords:       
     Lang:          |       Patch:       
 Platform:          |  
--------------------+-------------------------------------------------------

Comment(by pmichaud):

 > my getter is marked :multi(), yet accepts arity-2 calls.  I can't see
 how that's correct.

 The :multi() pragma is used only to constrain the types and minimum number
 of arguments, it does not provide an arity-based constraint.  In
 particular,  :multi(['Foo'])  simply says that the first argument must be
 of type 'Foo', it doesn't limit the sub to calls with only one argument.

 :multi(_) says that a sub requires at least one argument (but may have
 more), and that argument may be of any type.

 Thus ":multi()" simply says that a given sub is a MultiSub and has to have
 at least zero arguments to be invoked (but is allowed to have more).

 Pm

-- 
Ticket URL: <https://trac.parrot.org/parrot/ticket/1033#comment:6>
Parrot <https://trac.parrot.org/parrot/>
Parrot Development
_______________________________________________
parrot-tickets mailing list
[email protected]
http://lists.parrot.org/mailman/listinfo/parrot-tickets

Reply via email to