Fix repeated type ascription.
original commit: d2a1470ea51b5ca55656833f95dacd5ae7ba1285
This commit is contained in:
parent
2776f825c2
commit
29cd6cac2f
12
collects/tests/typed-scheme/succeed/float-internal-err.rkt
Normal file
12
collects/tests/typed-scheme/succeed/float-internal-err.rkt
Normal file
|
@ -0,0 +1,12 @@
|
|||
#lang typed/scheme
|
||||
|
||||
(require racket/flonum)
|
||||
|
||||
(define-syntax FLOAT* (syntax-rules () ((FLOAT* x ...) (ann (* (ann x Float) ...) Float))))
|
||||
(define-syntax FLOATsin (syntax-rules () ((FLOATsin x) (ann (flsin (ann x Float)) Float))))
|
||||
|
||||
(: tfo-align Any)
|
||||
(define (tfo-align) 0.0
|
||||
|
||||
(let* ((x (FLOAT* 0.0 (FLOATsin 0.))))
|
||||
0))
|
|
@ -63,11 +63,24 @@
|
|||
(parse-tc-results prop)
|
||||
(parse-tc-results/id stx prop)))
|
||||
(cond
|
||||
[(syntax-property stx type-ascrip-symbol) => pt]
|
||||
[(syntax-property stx type-ascrip-symbol)
|
||||
=>
|
||||
(lambda (prop)
|
||||
(if (pair? prop)
|
||||
(pt (car prop))
|
||||
(pt prop)))]
|
||||
[else #f]))
|
||||
|
||||
(define (remove-ascription stx)
|
||||
(syntax-property stx type-ascrip-symbol #f))
|
||||
(syntax-property stx type-ascrip-symbol
|
||||
(cond
|
||||
[(syntax-property stx type-ascrip-symbol)
|
||||
=>
|
||||
(lambda (prop)
|
||||
(if (pair? prop)
|
||||
(cdr prop)
|
||||
#f))]
|
||||
[else #f])))
|
||||
|
||||
(define (log/ann stx ty)
|
||||
(printf/log "Required Annotated Variable: ~a ~a~n" (syntax-e stx) ty))
|
||||
|
|
Loading…
Reference in New Issue
Block a user