plait icon indicating copy to clipboard operation
plait copied to clipboard

type-case on a pair-type results in an internal contract error

Open stites opened this issue 6 months ago • 0 comments

#lang plait

(f : (('a * 'b) -> (Listof 'a)))
(define (f ab)
  (type-case ('a * 'b) ab
     [(pair a b) '()]))

Which results in a contract violation from plait's internal code:

❯ racket test.rkt
syntax-local-value: contract violation
  expected: identifier?
  given: #<syntax:test.rkt:20:14 (quote a)>
  context...:
   /home/stites/.local/share/racket/8.10/pkgs/plait/main.rkt:1262:3

This seems like a situation where it might be nice to have a more user-friendly error.

stites avatar Jan 31 '24 20:01 stites