Opened 3 months ago
Last modified 3 months ago
#1859 new defect
Type information doesn't survive calls to define-inline procedures
| Reported by: | sjamaan | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | someday |
| Component: | scrutinizer | Version: | 6.0.0 |
| Keywords: | Cc: | ||
| Estimated difficulty: | medium |
Description
Compile the following to C:
(module foo ()
(import scheme (chicken base) (chicken plist))
(let ((x (gensym)))
(put! 'foo x 1))
(define-inline (put-one! sym prop)
(put! sym prop 1))
(let ((y (gensym)))
(put-one! 'foo y)))
Note that the first call to put! gets rewritten to C_a_i_putprop(&a,3,lf[1],t1,C_fix(1)), but the second call remains a CPS call to chicken.plist#put! via procedure lookup.
This is unexpected, as inlining by hand should give the same results as calling a define-inline procedure.
If you restore the typing info by hand, it also works as expected:
(define-inline (put-one! sym prop) (put! (the symbol sym) (the symbol prop) 1))
Note:
See TracTickets
for help on using tickets.

BTW, it's also a bit strange that the types can't be determined for procedures that get contracted or inlined by the compiler when using regular
define.