rhombus-prototype icon indicating copy to clipboard operation
rhombus-prototype copied to clipboard

Using a `term_option_sequence` in a term-only context gives an internal error

Open distractedlambda opened this issue 9 months ago • 0 comments

The following syntax class definition:

syntax_class Nonsense:
  kind: ~term
  fields
| '$(term_option_sequence | '~foo')'

results in an error within expanded code, instead of some sort of error on term_option_sequence:

.../amalgam/unquote-binding-primitive.rkt:685:45: pattern: head pattern not allowed here
  at: #{~seq} #{(~and (~seq options ...) (~or* (~and (~seq #:foo) (~seq temp1 ...) (~do))))} #{...}
  in: pattern #{(~and (~seq (~and (~seq options ...) (~or* (~and (~seq #:foo) (~seq temp1 ...) (~do)))) ...) ~! (~fail #:when (check-duplicate-matches (attribute temp1)) "mulitple uses of option not allowed"))} ~do #{()}
  location...:
   .../amalgam/unquote-binding-primitive.rkt:685:45

distractedlambda avatar May 07 '25 14:05 distractedlambda