Hello Racket users,

I am trying to understand a contract violation message that I am getting.
Here is the file a.rkt:

    #lang racket
    (provide f)
    (define/contract (f a)
      (-> boolean? any/c)
      '())

and this is b.rkt:

    #lang racket
    (require "a.rkt")
    (f 3)


I would expect that the caller is blamed for the contract violation, but the 
error message that I get is as follows:


f: contract violation
  expected: boolean?
  given: 3
  in: the 1st argument of
      (-> boolean? any/c)
  contract from: (function f)
  blaming: /home/epi/snippets/a.rkt
   (assuming the contract is correct)
  at: /home/epi/snippets/a.rkt:3.18
  context...:
   /usr/share/racket/collects/racket/contract/private/blame.rkt:347:0: 
raise-blame-error
   
/usr/share/racket/collects/racket/contract/private/arrow-higher-order.rkt:379:33
   body of "/home/dan/snippets/blameme.rkt"

So, I am a bit surprised that the error message blames the file a.rkt.
What am I missing here?

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/149cfc632cd666ff1a92177dce90296b%40disroot.org.

Reply via email to