fix inference with define-new-subtype
This commit is contained in:
parent
af2c22f542
commit
efb877dbfb
|
@ -540,6 +540,13 @@
|
|||
#:when v)
|
||||
v))]
|
||||
|
||||
;; from define-new-subtype
|
||||
[((Distinction: nm1 id1 S) (app resolve (Distinction: nm2 id2 T)))
|
||||
#:when (and (equal? nm1 nm2) (equal? id1 id2))
|
||||
(cg S T)]
|
||||
[((Distinction: _ _ S) T)
|
||||
(cg S T)]
|
||||
|
||||
;; two structs with the same name
|
||||
;; just check pairwise on the fields
|
||||
[((Struct: nm _ flds proc _ _) (Struct: nm* _ flds* proc* _ _))
|
||||
|
|
8
typed-racket-test/succeed/define-new-subtype-infer.rkt
Normal file
8
typed-racket-test/succeed/define-new-subtype-infer.rkt
Normal file
|
@ -0,0 +1,8 @@
|
|||
#lang typed/racket
|
||||
|
||||
(define-new-subtype T (make-T (List Integer)))
|
||||
|
||||
(: f : T -> Integer)
|
||||
(define (f t)
|
||||
(define x (car t))
|
||||
(* x 2))
|
Loading…
Reference in New Issue
Block a user