Opened 7 years ago

Closed 7 years ago

#898 closed defect (fixed)

scrutinizer gives spurious warnings when given too many type hints

Reported by: megane Owned by:
Priority: minor Milestone:
Component: scrutinizer Version: 4.8.x
Keywords: types Cc:
Estimated difficulty:

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

Change History (2)

comment:1 Changed 7 years ago by sjamaan

Fixed by 790bbb6ccd599781507546acd20115df39d68382

comment:2 Changed 7 years ago by sjamaan

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