Use the correct index for unsafe-Type-key
The unsafe operation didn't return the same result as the safe operation, meaning any checks related to type keys were giving the wrong result. As a result, some subtyping clauses were not triggered. original commit: 7907320733b6d29b2382e016c10888acbf4e1c67
This commit is contained in:
parent
2dd8725cbd
commit
2665e2b916
|
@ -356,7 +356,7 @@
|
|||
|
||||
;; NOTE: change these if the definitions above change, or everything will segfault
|
||||
(define-syntax-rule (unsafe-Rep-seq v) (unsafe-struct*-ref v 0))
|
||||
(define-syntax-rule (unsafe-Type-key v) (unsafe-struct*-ref v 1))
|
||||
(define-syntax-rule (unsafe-Type-key v) (unsafe-struct*-ref v 4))
|
||||
(provide unsafe-Rep-seq unsafe-Type-key)
|
||||
|
||||
(define (Rep-values rep)
|
||||
|
|
|
@ -448,7 +448,6 @@
|
|||
[((Base: _ _ _ #t) (Union: l2))
|
||||
#:when (eq? kt 'number)
|
||||
(and (memq s l2) A0)]
|
||||
;; this appears to never be called
|
||||
[((Union: l1) (Union: l2))
|
||||
#:when (and (eq? ks 'number) (eq? kt 'number))
|
||||
;; l1 should be a subset of l2
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
#lang racket/base
|
||||
|
||||
;; Tests for TR representation data structures such as types
|
||||
|
||||
(require "test-utils.rkt"
|
||||
rackunit
|
||||
typed-racket/rep/rep-utils
|
||||
typed-racket/rep/type-rep
|
||||
typed-racket/types/abbrev)
|
||||
|
||||
(provide tests)
|
||||
(gen-test-main)
|
||||
|
||||
(define tests
|
||||
(test-suite
|
||||
"Tests for TR IR data structures"
|
||||
|
||||
;; Make sure that unsafe operations return the same results as safe ones
|
||||
(check-equal? (Rep-seq -String) (unsafe-Rep-seq -String))
|
||||
(check-equal? (Rep-seq (-pair -String -String)) (unsafe-Rep-seq (-pair -String -String)))
|
||||
(check-equal? (Type-key -String) (unsafe-Type-key -String))
|
||||
(check-equal? (Type-key (-pair -String -String)) (unsafe-Type-key (-pair -String -String)))
|
||||
))
|
Loading…
Reference in New Issue
Block a user