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

 
 

bug #43749: writing to parameter / type-switch

Submitted by:  Seth Alves <sethalves>
Submitted on:  Thu 04 Dec 2014 02:21:03 AM UTC  
 
Category: Scheme languageSeverity: 3 - Normal
Item Group: Run-time exceptionStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Open

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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 File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item

    Back to the top


    Powered by Savane 3.1-cleanup1