Fix repeated type ascription.
This commit is contained in:
parent
7ecf424ff8
commit
d2a1470ea5
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 prop)
|
||||||
(parse-tc-results/id stx prop)))
|
(parse-tc-results/id stx prop)))
|
||||||
(cond
|
(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]))
|
[else #f]))
|
||||||
|
|
||||||
(define (remove-ascription stx)
|
(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)
|
(define (log/ann stx ty)
|
||||||
(printf/log "Required Annotated Variable: ~a ~a~n" (syntax-e stx) ty))
|
(printf/log "Required Annotated Variable: ~a ~a~n" (syntax-e stx) ty))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user