~ chicken-core (chicken-5) /tests/specialization-test-2.scm
Trap1;;;; specialization-test-2.scm234(module main ()5(import scheme chicken.base chicken.foreign)6(import-syntax foo) ; note: does not load foo!78#>9static int inlined(int i) {10static int n = 0;11n += i;12return n;}13<#1415(assert (= 1 (bar 1)))1617)181920;; #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" itself2324(define (bug855 x)25 (let ((y (car x)))26 (zero? (string-length y))))2728(assert (handle-exceptions ex #t (bug855 '(#f)) #f))2930;; #1219: Specializations from databases loaded with "-types" should31;; be applied.32(define (specialize-me x)33 (error "Not specialized!"))3435(assert (= (specialize-me 123) 123))