Opened 15 years ago

Closed 15 years ago

#17 closed defect (fixed)

use of `define-foreign-record-type' expands into incorrect result type identifier

Reported by: felix winkelmann Owned by: felix winkelmann
Priority: critical Milestone:
Component: compiler Version: 4.0.1
Keywords: foreigners Cc: Jim Ursetto
Estimated difficulty:

Description

Shawn Rutledge reported this problem:

(module foo *

(import scheme chicken foreign)
(use foreigners)

(define-foreign-record-type (vtable "struct DBusObjectPathVTable")
  (c-pointer dbus_internal_pad4 vtable-dbus_internal_pad4 vtable-dbus_internal_pad4-set!))

)

gives:

Error: illegal foreign return type `#%void'

I assume that there is some bug in either the foreigners extension or the interplay of define-foreign-record-type
and the core FFI is wrong, or that the compiler does not
strip-syntax a type-identifier somewhere.

Change History (3)

comment:1 Changed 15 years ago by felix winkelmann

Component: extensionscompiler
Owner: set to felix winkelmann
Status: newassigned

This is a chicken ffi/expander bug it seems as it can be reproduced by other means.

comment:2 Changed 15 years ago by Jim Ursetto

Cc: Jim Ursetto added

I fixed this a few days ago in r14310 foreigners/trunk, but I didn't tag a new release. It's tagged now, try again.

It happens because you may not provide renamed type identifiers to foreign-lambda*, and 'void' was being renamed. I changed it not to rename. Now if this was actually supposed to work, then I will change foreigners back once it is fixed.

comment:3 Changed 15 years ago by felix winkelmann

Resolution: fixed
Status: assignedclosed

Should work with r14447.

Note: See TracTickets for help on using tickets.