1;;;; specialization-test-2.scm
2
3
4(module main ()
5(import scheme chicken.base chicken.foreign)
6(import-syntax foo) ; note: does not load foo!
7
8#>
9static int inlined(int i) {
10static int n = 0;
11n += i;
12return n;}
13<#
14
15(assert (= 1 (bar 1)))
16
17)
18
19
20;; #855: second walk of arguments after specialization of call to "zero?"
21;;       applies enforced type-assumption for argument "y" to "string-length"
22;;       to call to "string-length" itself
23
24(define (bug855 x)
25  (let ((y (car x)))
26    (zero? (string-length y))))
27
28(assert (handle-exceptions ex #t (bug855 '(#f)) #f))
29
30;; #1219: Specializations from databases loaded with "-types" should
31;; be applied.
32(define (specialize-me x)
33  (error "Not specialized!"))
34
35(assert (= (specialize-me 123) 123))
36