Opened 12 years ago

Closed 12 years ago

#841 closed defect (worksforme)

tuples and skiplists: Many warnings (probably due to the contracts egg)

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

Description (last modified by sjamaan)

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:
The skiplists egg has the same problem:

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 (2)

comment:1 Changed 12 years ago by sjamaan

Description: modified (diff)
Summary: tuples: Many warnings (probably due to the contracts egg)tuples and skiplists: Many warnings (probably due to the contracts egg)

comment:2 Changed 12 years ago by juergen

Resolution: worksforme
Status: newclosed
Note: See TracTickets for help on using tickets.