Skip to content

Commit 27b5386

Browse files
capfredfsamth
authored andcommitted
fix a bug in comparing a parameter and a function
only turn a parameter into a function when the other type is also a function
1 parent 325f621 commit 27b5386

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

typed-racket-lib/typed-racket/types/subtype.rkt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1059,7 +1059,7 @@
10591059
[(Param: in2 out2) (subtype-seq A
10601060
(subtype* in2 in1)
10611061
(subtype* out1 out2))]
1062-
[_ (subtype* A (cl->* (t-> out1) (t-> in1 -Void)) t2)]
1062+
[(Fun: _) (subtype* A (cl->* (t-> out1) (t-> in1 -Void)) t2)]
10631063
[_ (continue<: A t1 t2 obj)])]
10641064
[(case: Poly (Poly: names b1))
10651065
(match t2
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#lang typed/racket/base
2+
(define-type Type1 (Parameterof Number))
3+
(define-type Type2 (U Type1 Symbol))
4+
(: x Type1)
5+
(define x (make-parameter 123))
6+
(ann x Type2)
7+
8+
(define-type Type11 (U Number (Parameter Type11)))
9+
(define-type Type12 (U Type11 Symbol))
10+
(ann (ann 123 Type11) Type12)
11+
12+
(define-type Type21 (U Number (Parameter Type22)))
13+
(define-type Type22 (U Type21 Symbol))
14+
(ann (ann 123 Type21) Type22)

0 commit comments

Comments
 (0)