Fix typecheck-fail
in TR
Closes PR 14449
This commit is contained in:
parent
34abe306e3
commit
9e7b013a7d
|
@ -113,9 +113,14 @@
|
||||||
[predicate-assertion
|
[predicate-assertion
|
||||||
(assert-predicate-internal type predicate)]
|
(assert-predicate-internal type predicate)]
|
||||||
[type-declaration
|
[type-declaration
|
||||||
(:-internal id:identifier type)]
|
(:-internal id:identifier type)])
|
||||||
[typecheck-failure
|
|
||||||
(typecheck-fail-internal stx message:str var:id)])
|
;; Define separately outside of `define-internal-classes` since this form
|
||||||
|
;; is meant to appear in expression positions, so it doesn't make sense to use
|
||||||
|
;; the `define-values` protocol used for other internal forms.
|
||||||
|
(define-syntax-class typecheck-failure
|
||||||
|
#:literal-sets (kernel-literals internal-literals)
|
||||||
|
(pattern (quote-syntax (typecheck-fail-internal stx message:str var))))
|
||||||
|
|
||||||
;;; Internal form creation
|
;;; Internal form creation
|
||||||
(begin-for-syntax
|
(begin-for-syntax
|
||||||
|
|
|
@ -2747,6 +2747,12 @@
|
||||||
(f 1 2 3))
|
(f 1 2 3))
|
||||||
#:ret (ret Univ -true-filter)]
|
#:ret (ret Univ -true-filter)]
|
||||||
|
|
||||||
|
;; typecheck-fail should fail
|
||||||
|
[tc-err (typecheck-fail #'stx "typecheck-fail")
|
||||||
|
#:msg #rx"typecheck-fail"]
|
||||||
|
[tc-err (string-append (typecheck-fail #'stx "typecheck-fail") "bar")
|
||||||
|
#:ret (ret -String)
|
||||||
|
#:msg #rx"typecheck-fail"]
|
||||||
)
|
)
|
||||||
(test-suite
|
(test-suite
|
||||||
"tc-literal tests"
|
"tc-literal tests"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user