bugKawa - Bugs: bug #6302, Internal define causes class cast...

 
 

bug #6302: Internal define causes class cast exception

Submitted by:  Chris Dean <ctdean>
Submitted on:  Sun 02 Nov 2003 12:21:05 AM UTC  
 
Category: Scheme languageSeverity: 3 - Normal
Item Group: Bad diagnosticStatus: Fixed
Privacy: PublicAssigned to: Per Bothner <bothner>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Thu 06 Nov 2003 04:16:44 AM UTC, comment #3:

I checked in fixes for this. The sample code now gives:
foo.scm:2:17: define is only allowed in a <body>

Per Bothner <bothner>
Project AdministratorIn charge of this item.
Sun 02 Nov 2003 07:07:23 PM UTC, comment #2:

Sure, I understand all that. A compile time error is a fine solution. Kawa is usually more forgiving than R5RS syntax, which is why I phrased it as I did.

Thanks!

Chris Dean <ctdean>
Sun 02 Nov 2003 08:38:23 AM UTC, comment #1:

The code is more than strange - it is not valid Scheme code.
You can have "internal definitions" in a <body>, but function
parameters are not a <body> in Scheme syntax.

The bug here is in Kawa not rejecting the program at
compile-time as having invalid syntax.

Per Bothner <bothner>
Project AdministratorIn charge of this item.
Sun 02 Nov 2003 12:21:05 AM UTC, original submission:

After compiling this (admittedly strange) code, we get a class cast excpetion when run. This code occurs in some autogenerated ares and is difficult to remove.

(define (foo)
(format "~A" (define (bar) 1)))

(format #t "result is ~S~%" (foo2))

This gives:

((Foo) this).id$bar = (Symbol) (gnu.mapping.Procedure) bar$Fn1;

The cast to (Symbol) is not the right bytecode to generate.

Chris Dean <ctdean>

 

(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

 

CC list is empty

 

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):

 

 

Follow 5 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Thu 06 Nov 2003 04:16:44 AM UTCbothnerStatusNone=>(Error - Not Found)
  Assigned toNone=>NA
  Open/ClosedOpen=>(Error - Not Found)
Sun 02 Nov 2003 08:38:23 AM UTCbothnerItem GroupRun-time exception=>(Error - Not Found)
Sun 02 Nov 2003 08:38:22 AM UTCbothnerCategoryCode generation=>(Error - Not Found)

Back to the top


Powered by Savane 3.1-cleanup1