diff --git a/scrutinizer.scm b/scrutinizer.scm index 697b24f..bb796b2 100755 --- a/scrutinizer.scm +++ b/scrutinizer.scm @@ -1029,6 +1029,9 @@ #t) (else #f)))) ((eq? t1 '*)) + ((eq? t2 '*) (and (not exact) (not all))) + ((eq? t1 'undefined) #f) + ((eq? t2 'undefined) #f) ((and (pair? t1) (eq? 'not (car t1))) (fluid-let ((exact #f) (all #f)) @@ -1061,7 +1064,6 @@ (match1 (third t1) t2)) ; assumes typeenv has already been extracted ((and (pair? t2) (eq? 'forall (car t2))) (match1 t1 (third t2))) ; assumes typeenv has already been extracted - ((eq? t2 '*) (and (not exact) (not all))) ((eq? t1 'noreturn) (not exact)) ((eq? t2 'noreturn) (not exact)) ((eq? t1 'number) diff --git a/tests/specialization-test-1.scm b/tests/specialization-test-1.scm index 0157420..37e8d6b 100644 --- a/tests/specialization-test-1.scm +++ b/tests/specialization-test-1.scm @@ -41,4 +41,10 @@ return n;} (set-cdr! x x) (assert (not (list? x)))) +;(define (some-proc x y) (if (string->number y) (set-cdr! x x) x)) +;(assert (null? (some-proc (list) "invalid number syntax"))) + +(assert (null? (the (or undefined *) (list)))) + + ) diff --git a/types.db b/types.db index 61a3dd1..9bd427e 100644 --- a/types.db +++ b/types.db @@ -783,9 +783,10 @@ (enable-warnings (#(procedure #:clean) enable-warnings (#!optional *) *)) (equal=? (#(procedure #:clean) equal=? (* *) boolean) - (((or fixnum symbol char eof null undefined) *) (eq? #(1) #(2))) - ((* (or fixnum symbol char eof null undefined)) (eq? #(1) #(2))) - (((or float number) (or float number)) (= #(1) #(2)))) + ((fixnum fixnum) (eq? #(1) #(2))) + (((or symbol char eof null) *) (eq? #(1) #(2))) + ((* (or symbol char eof null undefined)) (eq? #(1) #(2))) + (((or float fixnum number) (or float fixnum number)) (= #(1) #(2)))) (er-macro-transformer (#(procedure #:clean #:enforce)