Unfortunately, the implementation of `match` works in such a way that
figuring that out is beyond the capability of TR. For this specific
case, TR could know when a local binding of a function is
unreferenced, and thus the body is unreachable, but for more
complicated cases the expansion of `match` will be hard to figure out.

Sam

On Wed, Mar 23, 2016 at 12:57 PM, 'John Clements' via Racket Users
<racket-users@googlegroups.com> wrote:
>
>> On Mar 23, 2016, at 9:48 AM, Sam Tobin-Hochstadt <sa...@cs.indiana.edu> 
>> wrote:
>>
>> On Wed, Mar 23, 2016 at 12:47 PM, 'John Clements' via Racket Users
>> <racket-users@googlegroups.com> wrote:
>>> Is there a way in TR to ensure that a match is exhaustive at type-checking 
>>> time? It seems to me like the right design would be a special TR form that 
>>> goes in expression positions and always signals a type error.
>>
>> Indeed, see `typecheck-fail`:
>> http://docs.racket-lang.org/ts-reference/Utilities.html#%28form._%28%28lib._typed-racket%2Fbase-env%2Fprims..rkt%29._typecheck-fail%29%29
>
> Nice! … Okay, now I just need help with ‘match’; is there a way to get 
> ‘match’ (or, more specifically, TR + the expansion of match) to deduce that 
> the last clause is unreachable in the example I presented?
>
> John
>
>
>
> --
> 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