nuprl / gradual-typing-performance

10 stars 5 forks source link

Synth does not type check with Racket HEAD #116

Closed sabauma closed 8 years ago

sabauma commented 8 years ago

Newer versions of Typed Racket seem to have changed the type of expt. Synth produces the following error message when run using Racket HEAD.

sequencer.rkt:26:14: Type Checker: type mismatch
  expected: Nonnegative-Real
  given: Number
  in: (* 440 (expt (expt 2 1/12) (- note 57)))
  context...:
   /home/spenser/local/racket-head/share/racket/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:318:0: type-check
   /home/spenser/local/racket-head/share/racket/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:562:0: tc-module
   /home/spenser/local/racket-head/share/racket/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:82:0: tc-module/full
   /home/spenser/local/racket-head/share/racket/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:24:4
   standard-module-name-resolver
   temp8
   /home/spenser/local/racket-head/share/racket/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:82:0: tc-module/full
samth commented 8 years ago

@stamourv may be interested.

stamourv commented 8 years ago

That annotation is too strict. (expt <Nonnegative-Real> <Integer>) is not guaranteed to return a Nonnegative-Real. The old type for expt erroneously let that through. Changing to Number should fix it.

bennn commented 8 years ago

Yep. (quad also had trouble on head; that's fixed in 2a34e17)