Skip to content

Commit 330527d

Browse files
committed
Improve source locations for cast.
Fixes #1027.
1 parent 38f6387 commit 330527d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

typed-racket-lib/typed-racket/base-env/prims-contract.rkt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,9 @@
285285
(λ ()
286286
(define type-stx
287287
(let ([types (cast-table-ref id)])
288-
(if types
289-
#`(U #,@types)
290-
#f)))
288+
(cond [(not types) #f]
289+
[(null? (cdr types)) (car types)]
290+
[else (quasisyntax/loc (car types) (U #,@types))])))
291291
`#s(contract-def ,type-stx ,flat? ,maker? typed))))
292292

293293

0 commit comments

Comments
 (0)