









@samth I’m still getting a similar (if not the same) error: ->
#<procedure:rhs?>
boolean?
listof
#<procedure:sattr?:1>
#<procedure:rhs?>
<collects>/syntax/parse/private/rep.rkt
ERROR : fixup-rhs: contract violation
expected: #<procedure:rhs?>
given: #s(rhs (#s(attr value 0 #f)) #t #<syntax> (#s(variant #<syntax> (#s(attr value 0 #f) #s(attr x 0 #t)) #s(pat:and (#s(pat:ord #s(pat:fixup #<syntax> #<syntax> #<syntax> #<syntax> #s(arguments () () ()) #f #f) group2 0) #s(pat:ord #s(pat:action #s(action:and (#s(action:ord #s(action:post #s(action:fail #<syntax> #<syntax>)) group1 0) #s(action:bind #s(attr #<syntax> 0 #f) #<syntax>) #s(action:ord #s(action:post #s(action:fail #<syntax> #<syntax>)) group1 2) #s(action:ord #s(action:post #s(action:fail #<syntax> #<syntax>)) group1 3) #s(action:do (#<syntax>)))) #s(pat:any)) group2 1))) ())) () #t #t)
in: the 1st argument of
contract from:
blaming: <collects>/syntax/parse/private/parse.rkt
(assuming the contract is correct)
at: <collects>/syntax/parse/private/rep.rkt:1.0

That’s the same thing

Probably somewhere else that needs interning

I double checked that everything in the previous issue is solved now, now looking at the different places in the structs impl that intern things

@samth Is there any reason we would want to unintern things when we look it up in the table? https://github.com/pycket/pycket/blob/569adf5c90708e180c41b0bf4d726640e7a54332/pycket/values_struct.py#L103


@cadr here’s a test case: (module pref '#%kernel
(define-values
(struct:a make-a a? a-b a-c)
(let-values (((struct: make- ? -ref -set!)
(let-values ()
(let-values ()
(#%app
make-struct-type
'a
'#f
'2
'0
'#f
null
'prefab
'#f
'(0 1)
'#f
'a)))))
(#%app
values
struct:
make-
?
(#%app make-struct-field-accessor -ref '0 'b)
(#%app make-struct-field-accessor -ref '1 'c))))
(define-values
(-struct:a -make-a -a? -a-b -a-c)
(let-values (((struct: make- ? -ref -set!)
(let-values ()
(let-values ()
(#%app
make-struct-type
'a
'#f
'2
'0
'#f
null
'prefab
'#f
'(0 1)
'#f
'a)))))
(#%app
values
struct:
make-
?
(#%app make-struct-field-accessor -ref '0 'b)
(#%app make-struct-field-accessor -ref '1 'c))))
(display (-a? (make-prefab-struct 'a 1 2))))

@samth my current fix makes this give #t

I can’t make the test fail, though



putting it in a separate test made it fail

and really running the test that way is so much faster

we should have been doing this long ago

I agree

@samth Here’s the new error wrong number of arguments to (lambda (v_709 neg-party_710) (let ([if10077 (p?_707 v_709)]) (if if10077 v_709 (let ([...act/private/prop.rkt:1:0_711 LinkletVar(raise-blame-error18.1:NO-VAL)][b84_712 b_708][neg-party85_713 neg-party_710][v86_714 v_709][temp87_715 '(expected: ~s given: ~e)][name88_716 name_706][v89_717 v_709][if10078 (variable-reference-constant? #<#%variable-reference>)]) (if if10078 (let ([AppRand48466 (list name88_716 v89_717)]) (LinkletVar(raise-blame-error16.1:NO-VAL) neg-party85_713 b84_712 v86_714 temp87_715 AppRand48466)) (let ([AppRator506 (checked-procedure-check-and-extract LinkletVar(struct:keyword-procedure:NO-VAL) ...act/private/prop.rkt:1:0_711 LinkletVar(keyword-procedure-extract:NO-VAL) '(#:missing-party) 7)][AppRand48467 (list neg-party85_713)]) (AppRator506 '(#:missing-party) AppRand48467 b84_712 v86_714 temp87_715 name88_716 v89_717))))))), expected 2 but got 1

ah I think I saw this with old pycket when I was trying to run some contract benchmarks

racket/contract/private/prop, line 519

(define (late-neg-first-order-projection name p?)
(λ (b)
(case-lambda
[(v neg-party)
(if (p? v)
v
(raise-blame-error
b #:missing-party neg-party
v
'(expected: "~s" given: "~e")
name
v))]
[args (eprintf "late-neg-first-order-projection got wrong argument count: ~s ~s" b args)
(error 'late-neg-first-order-projection "bad args")])))

@samth Here’s what we got : late-neg-first-order-projection got wrong argument count: #<blame-no-swap> (#<path:/home/cderici/racketland/racket/racket/collects/syntax/contract.rkt>)

with more information, here’s the same error: late-neg-first-order-projection got wrong argument count: #<blame-no-swap> #<procedure:> (or/c #f #<procedure:1/module-path?:321>) (#<path:/home/samth/sw/plt/racket/collects/syntax/contract.rkt>)

those are the two arguments to the outer function

but we still don’t know why it’s called wrongly

also, syntax/parse
errors, but syntax/parse/pre
does not

I wonder if it’s the use of contracts inside begin-for-syntax
in syntax/parse.rkt

this fails: pk -l syntax/parse/experimental/contract

so it’s not anything in parse.rkt

much smaller reproduction:

> (require syntax/modcollapse)
> (collapse-module-path-index (module-path-index-join 'racket/base #f))

#lang racket/base
(module m racket/base
(require racket/contract/base)
(provide (contract-out [collapse-module-path-index (case->
(any/c . -> . (or/c #f string?))
(any/c any/c . -> . any/c))]))
(define collapse-module-path-index
(case-lambda
[(a) "x.rkt"]
[(a b) "x.rkt"])))
(require 'm)
(collapse-module-path-index #f)

#lang racket/base
(require racket/contract/base)
(define collapse-module-path-index
(contract (case-> (-> any/c (or/c #f string?)))
(lambda (a) "x.rkt")
'a 'b))
(collapse-module-path-index #f)

the case->
is important

if you take out the with-contract-continuation-mark
in the body of new
around line 250 of case-arrow.rkt the bug goes away

[samth@huor:~/sw/pycket (master) plt] cat bad.rkt
#lang racket/base
(require racket/list)
(define blame #f)
(define (p x y) (+ x y))
(define h
(lambda args
(let ([args2 (map values args)])
(eprintf "is this bad? ~s ~s\n" args args2)
(begin
(with-continuation-mark (make-continuation-mark-key 'xxxxx)
(cons blame (last args))
(let ()
(eprintf "is this bad? ~s ~s\n" args args2)
(apply p args)))))))
(h 1 2)
[samth@huor:~/sw/pycket (master) plt] pk bad.rkt
is this bad? (1 2) (1 2)
exn:fail : variable args_3 is unbound
[samth@huor:~/sw/pycket (master) plt]

there’s the bug


@cadr and there we are

