bugKawa - Bugs: bug #43749, writing to parameter / type-switch

 
 

bug #43749: writing to parameter / type-switch

Submitter:  Seth Alves <sethalves>
Submitted:  Thu 04 Dec 2014 02:21:03 AM UTC
   
 
Category:  Scheme language Severity:  3 - Normal
Item Group:  Run-time exception Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 04 Dec 2014 02:21:03 AM UTC, original submission:  


Though it's poor form and easy to work around, most scheme's allow this:

(define (foo . opt)
  (set! opt (if (null? opt) #f (car opt)))
  opt)

(display (foo 1))
(newline)

./kawa-type-switch.scm:7:13: warning - type java.lang.Boolean is incompatible with required type list
./kawa-type-switch.scm:7:3: warning - cannot convert literal (of type java.lang.Boolean) to Type list
Value '1' for variable 'opt' has wrong type (integer) (gnu.math.IntNum cannot be cast to gnu.lists.LList)
    at kawa$Mntype$Mnswitch.foo$V(kawa-type-switch.scm:7)
    at kawa$Mntype$Mnswitch.applyN(kawa-type-switch.scm:6)
...

Seth Alves <sethalves>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by sethalves (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code