Fix type of expt.
Closes PR 12526.
This commit is contained in:
parent
87887b7a18
commit
1b6cf730c3
13
collects/tests/typed-racket/optimizer/tests/expt.rkt
Normal file
13
collects/tests/typed-racket/optimizer/tests/expt.rkt
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
#;
|
||||||
|
(
|
||||||
|
TR missed opt: expt.rkt 13:13 (expt (sin 0.25) 1.0) -- unexpected complex type
|
||||||
|
TR opt: expt.rkt 13:19 (sin 0.25) -- unary float
|
||||||
|
)
|
||||||
|
|
||||||
|
#lang typed/racket
|
||||||
|
|
||||||
|
;; PR 12526
|
||||||
|
;; result of expt was Float-Complex, and shouldn't have been
|
||||||
|
;; this let to incorrect optimization
|
||||||
|
(define (crash)
|
||||||
|
(real-part (expt (sin 0.25) 1.0)))
|
|
@ -1594,11 +1594,11 @@
|
||||||
(-PosReal -Real . -> . -PosReal)
|
(-PosReal -Real . -> . -PosReal)
|
||||||
(-NonNegReal -Real . -> . -NonNegReal)
|
(-NonNegReal -Real . -> . -NonNegReal)
|
||||||
(-Flonum -Integer . -> . -Flonum)
|
(-Flonum -Integer . -> . -Flonum)
|
||||||
(-Flonum -Real . -> . -FloatComplex)
|
(-Flonum -Real . -> . N)
|
||||||
(-SingleFlonum -Integer . -> . -SingleFlonum)
|
(-SingleFlonum -Integer . -> . -SingleFlonum)
|
||||||
(-SingleFlonum -SingleFlonum . -> . -SingleFlonumComplex)
|
(-SingleFlonum -SingleFlonum . -> . (Un -SingleFlonum -SingleFlonumComplex))
|
||||||
(-InexactReal -Integer . -> . -InexactReal)
|
(-InexactReal -Integer . -> . -InexactReal)
|
||||||
(-InexactReal -InexactReal . -> . -InexactComplex)
|
(-InexactReal -InexactReal . -> . (Un -InexactReal -InexactComplex))
|
||||||
(-ExactNumber -ExactNumber . -> . -ExactNumber)
|
(-ExactNumber -ExactNumber . -> . -ExactNumber)
|
||||||
(commutative-binop N -FloatComplex)
|
(commutative-binop N -FloatComplex)
|
||||||
(commutative-binop (Un -ExactNumber -SingleFlonum -SingleFlonumComplex) -SingleFlonumComplex)
|
(commutative-binop (Un -ExactNumber -SingleFlonum -SingleFlonumComplex) -SingleFlonumComplex)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user