~ chicken-core (master) /tests/specialization-tests.scm
Trap1;; both arms of if branches are dropped23(let ((a "yep")) (if (string? a) 'ok 'no))4(let ((a 'nope)) (if (string? a) 'ok 'no))56;; bidirectional ports are specialized78(import (only (scheme base) open-input-string))910(let ((p (open-input-string "foo")))11 (when (output-port? p) ; indicates `p' is bidirectional12 (if (input-port? p) 'ok 'no)13 (if (output-port? p) 'ok 'no)))