<div dir="ltr">Yes: my message is about strange error messages that cause newbies to just conclude that testing TR programs doesn&#39;t work. While I can certainly fault someone for coming to this conclusion (and I did) I think only half of the problem is on their side.<div>
<br></div><div>If they had gotten this message, they might have said &quot;equal? isn&#39;t what I want here&quot; and then maybe made some progress.</div><div><br></div><div style>But I do agree with you and if it is hard to get to even this state, then it probably isn&#39;t worth pursuing.</div>
<div><br></div><div>Robby</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, May 29, 2013 at 10:11 AM, Matthias Felleisen <span dir="ltr">&lt;<a href="mailto:matthias@ccs.neu.edu" target="_blank">matthias@ccs.neu.edu</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
If TR lived up exactly to the R level of semantics, to wit:<br>
<br>
&gt; Welcome to DrRacket, version 5.3.4.10--2013-05-29(05524114/d) [3m].<br>
&gt; Language: racket.<br>
&gt; &gt; (struct s ())<br>
&gt; &gt; (require rackunit)<br>
&gt; &gt; (check-equal? (s) (s))<br>
&gt; --------------------<br>
&gt; FAILURE<br>
&gt; actual:     #&lt;s&gt;<br>
&gt; expected:   #&lt;s&gt;<br>
&gt; name:       check-equal?<br>
&gt; location:   (unsaved-editor324 5 2 126 22)<br>
&gt; expression: (check-equal? (s) (s))<br>
&gt;<br>
&gt; . . Check failure<br>
&gt; --------------------<br>
<br>
<br>
would you really write a different message to dev? Opaque structures pose a problem for testing and that problem exists at both levels.<br>
<span class="HOEnZb"><font color="#888888"><br>
-- Matthias<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
<br>
<br>
<br>
<br>
On May 29, 2013, at 8:02 AM, Robby Findler &lt;<a href="mailto:robby@eecs.northwestern.edu">robby@eecs.northwestern.edu</a>&gt; wrote:<br>
<br>
&gt; Well, given that replacing check-equal? with equal? (on the typed side) works, then it seems to me that one solution would be to move more of rackunit into TR, or to refactor rackunit to be more friendly to TR. (And if someone is going to work on this, then it would also be great if the error messages from failed test cases were made a bit more legible.)<br>

&gt;<br>
&gt; Robby<br>
&gt;<br>
&gt;<br>
&gt; On Wed, May 29, 2013 at 6:53 AM, Sam Tobin-Hochstadt &lt;<a href="mailto:samth@ccs.neu.edu">samth@ccs.neu.edu</a>&gt; wrote:<br>
&gt; That is indeed the correct fix.  I&#39;m not entirely sure how to improve<br>
&gt; the error message, since the problem in your original code is real.<br>
&gt; There&#39;s no way the generated contract can tell at runtime that the<br>
&gt; values passed to `check-equal?` aren&#39;t higher-order, so it has to<br>
&gt; conservatively reject the call.  Suggestions are certainly welcome.<br>
&gt;<br>
&gt; Sam<br>
&gt;<br>
&gt; On Wed, May 29, 2013 at 7:46 AM, Robby Findler<br>
&gt; &lt;<a href="mailto:robby@eecs.northwestern.edu">robby@eecs.northwestern.edu</a>&gt; wrote:<br>
&gt; &gt; I&#39;m not sure if this should be considered a bug or a feature request (or<br>
&gt; &gt; something else, but hopefully one of those two!) so I thought I&#39;d ask here<br>
&gt; &gt; before sending in a PR. This program:<br>
&gt; &gt;<br>
&gt; &gt;   #lang typed/racket<br>
&gt; &gt;   (require typed/rackunit)<br>
&gt; &gt;   (struct: s ([a : Integer]))<br>
&gt; &gt;   (check-equal? (s 1) (s 2))<br>
&gt; &gt;<br>
&gt; &gt; produces the output:<br>
&gt; &gt;<br>
&gt; &gt; check-equal?: broke its contract<br>
&gt; &gt;   Attempted to use a higher-order value passed as `Any` in untyped code:<br>
&gt; &gt; #&lt;s&gt;<br>
&gt; &gt;   in: the 1st argument of<br>
&gt; &gt;       (recursive-contract<br>
&gt; &gt;        (-&gt;* (Any Any) (String) any/c)<br>
&gt; &gt;        #:impersonator)<br>
&gt; &gt;   contract from: (interface for check-equal?)<br>
&gt; &gt;   blaming: (interface for check-equal?)<br>
&gt; &gt;   at: &lt;collects&gt;/typed/rackunit/main.rkt:20.2<br>
&gt; &gt;<br>
&gt; &gt; which is a bit confusing. (As someone who&#39;s been around Racket long enough,<br>
&gt; &gt; I guessed that sticking #:transparent into the struct declaration would be a<br>
&gt; &gt; thing to try, but newcomers seem unlikely to find that workaround.)<br>
&gt; &gt;<br>
&gt; &gt; Robby<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; _________________________<br>
&gt; &gt;   Racket Developers list:<br>
&gt; &gt;   <a href="http://lists.racket-lang.org/dev" target="_blank">http://lists.racket-lang.org/dev</a><br>
&gt; &gt;<br>
&gt;<br>
&gt; _________________________<br>
&gt;  Racket Developers list:<br>
&gt;  <a href="http://lists.racket-lang.org/dev" target="_blank">http://lists.racket-lang.org/dev</a><br>
<br>
</div></div></blockquote></div><br></div>