Translate Value types to ctcs with better names
e.g., True -> '#t instead of True -> "#t" for a flat-named-contract
This commit is contained in:
parent
fe83da9bdf
commit
0161dfdf16
14
collects/tests/typed-racket/fail/flat-contract-name.rkt
Normal file
14
collects/tests/typed-racket/fail/flat-contract-name.rkt
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
#;
|
||||||
|
(exn-pred #rx"expected: 0")
|
||||||
|
|
||||||
|
#lang racket
|
||||||
|
|
||||||
|
;; The purpose of this test is to make sure that contract
|
||||||
|
;; errors for (Value x) types print in a good way
|
||||||
|
|
||||||
|
(module a typed/racket
|
||||||
|
(define: (f [x : Zero]) : Zero x)
|
||||||
|
(provide f))
|
||||||
|
|
||||||
|
(require 'a)
|
||||||
|
(f "foo")
|
|
@ -422,7 +422,7 @@
|
||||||
[(Syntax: (Base: 'Symbol _ _ _ _)) #'identifier?]
|
[(Syntax: (Base: 'Symbol _ _ _ _)) #'identifier?]
|
||||||
[(Syntax: t)
|
[(Syntax: t)
|
||||||
#`(syntax/c #,(t->c t #:kind flat-sym))]
|
#`(syntax/c #,(t->c t #:kind flat-sym))]
|
||||||
[(Value: v) #`(flat-named-contract #,(format "~a" v) (lambda (x) (equal? x '#,v)))]
|
[(Value: v) #`(flat-named-contract '#,v (lambda (x) (equal? x '#,v)))]
|
||||||
;; TODO Is this sound?
|
;; TODO Is this sound?
|
||||||
[(Param: in out)
|
[(Param: in out)
|
||||||
(set-impersonator!)
|
(set-impersonator!)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user