Fix make-predicate
at the top-level
This solves the immediate problem, but more generally the
handling of ignored syntax at the top-level seems very fishy.
There is a complicated protocol involving the top-level
type-checker returning #<void> for cases with no obvious
return type, but it's unclear if it actually works. That
code in tc-toplevel.rkt should be revamped in the future.
Closes PR 14030
Please merge into 6.0
(cherry picked from commit f292a9c0f2
)
This commit is contained in:
parent
fff9125165
commit
b3e3acb85b
|
@ -262,7 +262,8 @@ This file defines two sorts of primitives. All of them are provided into any mod
|
||||||
(if (Error? typ)
|
(if (Error? typ)
|
||||||
;; This code should never get run, typechecking will have an error earlier
|
;; This code should never get run, typechecking will have an error earlier
|
||||||
#`(error 'make-predicate "Couldn't parse type")
|
#`(error 'make-predicate "Couldn't parse type")
|
||||||
#`(ann
|
#`(let ()
|
||||||
|
(ann
|
||||||
#,(ignore-some-property
|
#,(ignore-some-property
|
||||||
(type->contract
|
(type->contract
|
||||||
typ
|
typ
|
||||||
|
@ -272,7 +273,7 @@ This file defines two sorts of primitives. All of them are provided into any mod
|
||||||
#:typed-side #f
|
#:typed-side #f
|
||||||
(type->contract-fail typ #'ty #:ctc-str "predicate"))
|
(type->contract-fail typ #'ty #:ctc-str "predicate"))
|
||||||
#t)
|
#t)
|
||||||
(Any -> Boolean : ty)))))]))
|
(Any -> Boolean : ty))))))]))
|
||||||
|
|
||||||
(define-syntax (cast stx)
|
(define-syntax (cast stx)
|
||||||
(syntax-parse stx
|
(syntax-parse stx
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
#lang racket/load
|
||||||
|
;; Test for PR 14030
|
||||||
|
(require typed/racket)
|
||||||
|
(make-predicate Integer)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user