Summary

scrutinizer gives spurious warnings when given too many type hints

Metadata

Description

This is potentially confusing for users of eggs for which type annotations are added afterwards.

Initially the user's own annotations seem to work. When the annotations are added to the egg, user starts to get these strange messages shown below.

 (define-record foo a)
 (define-type foo-t (struct foo))
 
 (define (t1)
   (the foo-t (the foo-t (make-foo))))	; OK
 
 (define (t2)
   (the (struct foo) (the (struct foo) (make-foo))))
 
 (: bar (procedure () (struct foo)))
 (define (bar)
   (make-foo))
 
 (define (t3)
   (the (struct foo) (bar)))
 
 
 ;; $ csc -verbose -specialize  foo.scm
 
 ;; Note: in toplevel procedure `t2':
 ;;   expression returns a result of type `(struct foo)', but is declared to return `(struct foo)', which is not a subtype
 
 ;; Note: in toplevel procedure `t3':
 ;;   expression returns a result of type `(struct foo)', but is declared to return `(struct foo)', which is not a subtype

Changes and comments

[2012-09-29 19:44:00 UTC] sjamaan wrote:

Fixed by 790bbb6ccd599781507546acd20115df39d68382

[2012-09-29 19:44:05 UTC] sjamaan changed status from new to closed

[2012-09-29 19:44:05 UTC] sjamaan set resolution to fixed