racket / rhombus

Rhombus programming language
Other
350 stars 62 forks source link

arity error in annot.macro implementation #468

Closed rfindler closed 9 months ago

rfindler commented 9 months ago

This program:

#lang rhombus/and_meta

annot.macro '$d -> $r':
  'converting(fun (x): x)'

def h :: Int -> Boolean:
  1

produces the error

...ate/annot-macro.rkt:86:3: wrong number of arguments in function call
  expected: 2
  given: 3

probably because a protocol somewhere changed and annot.macro didn't get updated. Specifically, it looks like this function should actually have three arguments.

usaoc commented 9 months ago

What’s happening is that it’s missing handling of the automatic protocol, which passes three arguments instead of two. The automatic protocol is used here because the pattern requires a parsed right-hand side.

rfindler commented 9 months ago

Thanks!