macrotypes icon indicating copy to clipboard operation
macrotypes copied to clipboard

Type pattern expander in custom syntax class has confusing error

Open iitalics opened this issue 9 years ago • 0 comments

For some reason, using the generated ~ pattern expanders for types does not work in (define-syntax-class ...). As a simple example,

#lang turnstile

(define-type-constructor List #:arity = 1)

(begin-for-syntax
  (define-syntax-class list-τ
    (pattern (~List _))))

produces the error

pattern: required attribute is not defined: g86
;   in: (pattern (~List _))

I think this has something to do with the temporary generated for use in producing the "Expected _, got: _" error.

iitalics avatar Apr 22 '17 19:04 iitalics