Opened 10 years ago

Closed 10 years ago

#17 closed defect (fixed)

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

Reported by: felix Owned by: felix
Priority: critical Milestone:
Component: compiler Version: 4.0.1
Keywords: foreigners Cc: zbigniew
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 10 years ago by felix

  • Component changed from extensions to compiler
  • Owner set to felix
  • Status changed from new to assigned

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

comment:2 Changed 10 years ago by zbigniew

  • Cc zbigniew 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 10 years ago by felix

  • Resolution set to fixed
  • Status changed from assigned to closed

Should work with r14447.

Note: See TracTickets for help on using tickets.