errors3.scm 373 B

123456789
  1. (define b::boolean #t)
  2. (try-catch
  3. (let ((i::int b))
  4. (format #t "Missing exception i: ~w~%" i))
  5. (ex java.lang.Exception
  6. (format #t "Caught: ~w~%" ex)))
  7. ;; Diagnostic: errors3.scm:2:1: warning - type boolean is incompatible with required type int
  8. ;; Output-pattern: Caught: java.lang.ClassCastException: .*java.lang.Boolean cannot be cast to .*java.lang.Integer.*