overload2.scm 518 B

12345678910111213141516
  1. ;; Test contributed by Victor van den Elzen
  2. ;; for Savannah bug #36973: "poor overload resolution when boxing numerics"
  3. (define-simple-class ContentValues ()
  4. ((put s::java.lang.String d::double) ::void
  5. (format #t "called ContentValues(String,double)~%"))
  6. ((put s::java.lang.String l::long) ::void
  7. (format #t "called ContentValues(String,long)~%")))
  8. (define (foo cv::ContentValues s::java.lang.String l::long)
  9. (cv:put s l))
  10. (foo (ContentValues) "hello" 123)
  11. ;; Output: called ContentValues(String,long)