I've pushed a fix for this. After the fix, the contract system
properly cooperates with errortrace and so DrRacket should highlight
exactly the right place in this program. It also makes the more
standard stacktraces better too, but may not help you much in this
case if you don't use errortrace (or DrRacket).

Robby

On Wed, May 18, 2016 at 2:55 PM, Braids Constance <braid...@gmail.com> wrote:
> i made a one-character typo that created an error without a relevant line 
> number.  when applying a (listof predicate) in my struct's contract, i 
> accidentally supplied a non-predicate function -- which is very easy to do 
> when the predicate is the name of a struct.  (i forgot the question mark.)
>
> =====
> #lang racket
>
> (module pie racket
>   (struct paperclip ())
>   (provide (struct-out paperclip))
>
>   (struct cup (contents))
>   (provide (contract-out
>             [struct cup ((contents (listof paperclip)))])) ;bug
>   );mod
>
> (require 'pie)
> (define best-mom (cup '(oops)))
> =====
>
> i get the following error in DrRacket:
>
> =====
> listof: contract violation
>   expected: contract?
>   given: #<procedure:paperclip>
>
> D:\cygwin64\usr\local\racket\collects\racket\contract\private\guts.rkt: 
> 427:23                        #'(app ctc/proc margs (... ...))
>
> D:\cygwin64\usr\local\racket\collects\racket\contract\private\provide.rkt: 
> 827:47                                                  (coerce-contract 
> 'provide/contract field-contract)
> =====
>
> is there a way to get an error message with more relevant context?
>
>
> braids
>
> --
> 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.
> For more options, visit https://groups.google.com/d/optout.

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to