Summary
use of `define-foreign-record-type' expands into incorrect result type identifier
Metadata
- Id: 04833ce1717908ab24fb8e1f4129e28b9e9a7288
- Trac id: 17
- Type: defect
- Reporter: felix
- Owner: felix
- Cc: zbigniew
- Status: closed
- Component: compiler
- Estimated difficulty:
- Resolution: fixed
- Priority: critical
- Milestone:
- Version: 4.0.1
- Changetime: 2009-04-26 00:12:30 UTC
- Created: 2009-04-24 12:19:11 UTC
- Keywords: foreigners
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.
Changes and comments
[2009-04-24 17:24:06 UTC] felix changed status from new to assigned
[2009-04-24 17:24:06 UTC] felix set owner to felix
[2009-04-24 17:24:06 UTC] felix changed component from extensions to compiler
[2009-04-24 17:24:06 UTC] felix wrote:
This is a chicken ffi/expander bug it seems as it can be reproduced by other means.
[2009-04-24 17:44:36 UTC] zbigniew set cc to zbigniew
[2009-04-24 17:44:36 UTC] zbigniew wrote:
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.
[2009-04-26 00:12:30 UTC] felix changed status from assigned to closed
[2009-04-26 00:12:30 UTC] felix set resolution to fixed
[2009-04-26 00:12:30 UTC] felix wrote:
Should work with r14447.