pact icon indicating copy to clipboard operation
pact copied to clipboard

Defuns Ignore Arg Requirement if None are Referenced in Body

Open emilypi opened this issue 6 years ago • 0 comments

Example:

pact> (module m g (defcap g () true) (defschema schema x:string) (defun f (obj:object{schema} k:bool j:integer) (= 1 1)) )
"Loaded module m, hash 5t7d6lIdsXH4BWmWAHYSiwcoTSILwU44rHi6m1eX2os"
pact> (use m)
"Using m"
pact> (f)
true

However, if args are referenced in the body, we get the appropriate error:

pact> (module m g (defcap g () true) (defschema schema x:string) (defun f (obj:object{schema} k:bool j:integer) (= j 1)) )
"Loaded module m, hash YItcOt-3GDLYi4kp-ePOwcH1-0JUfSEV2hjT37q-Bk4"
pact> (use m)
"Using m"
pact> (f)
<interactive>:0:0: Missing argument value at index 2
 at <interactive>:0:106: (= ("Missing argument value at index 2") 1)
 at <interactive>:0:0: (f)

emilypi avatar Sep 19 '19 16:09 emilypi