fix inference with define-new-subtype

This commit is contained in:
AlexKnauth 2015-08-15 14:36:45 -05:00
parent af2c22f542
commit efb877dbfb
2 changed files with 15 additions and 0 deletions

View File

@ -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* _ _))

View 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))