Opened 10 years ago

Last modified 10 years ago

#841 closed defect

tuples: Many warnings (probably due to the contracts egg) — at Initial Version

Reported by: sjamaan Owned by: juergen
Priority: minor Milestone:
Component: extensions Version: 4.7.x
Keywords: Cc:
Estimated difficulty:


We recently ran salmonella with the -specialize option (which implies the -scrutinize option), and it turns out that the tuples egg raises quite a few warnings when it's being compiled:

I attempted to track down the cause, but proved to be extremely difficult. It looks like it's not tuples itself that's in the wrong, but its use of the contracts egg is causing the trouble. When I compile the test suite of contracts with -specialize I also see a few warnings.

In the end I was able to reduce it to this program that fails:

(use contracts)

(define-with-contract (single xpr)
  (range (even? result))
  (lambda (sel) (print xpr)))

This is the warning I see:

$ csc -specialize contracts-test.scm
Warning: at toplevel:
  (contracts-test.scm:4) in procedure call to `g108109', expected 1 argument, but was given 0 arguments

When running with -debug 2, I see that single is a procedure which receives one "proc" argument, but it is called with zero arguments. Oddly enough, the code doesn't fail immediately. I really don't understand where it's going wrong, but the macros that apply here are quite complex! They're probably generating some dead code that is wrong even though it never gets called, and that's why the compiler still flags it.

Change History (0)

Note: See TracTickets for help on using tickets.