More tests for unboxed args of let-bound functions.
original commit: bb144249183f8e287a37a1590df5a5aa219862f8
This commit is contained in:
parent
da5586ca57
commit
7c875c3bb2
|
@ -0,0 +1,9 @@
|
|||
#lang typed/scheme #:optimize
|
||||
|
||||
(require racket/unsafe/ops)
|
||||
|
||||
;; function with multiple complex args
|
||||
(let ((f (lambda: ((x : Inexact-Complex) (y : Inexact-Complex))
|
||||
(+ x y))))
|
||||
(f (+ 1.0+2.0i 2.0+4.0i)
|
||||
3.0+6.0i))
|
|
@ -0,0 +1,9 @@
|
|||
#lang typed/scheme #:optimize
|
||||
|
||||
(require racket/unsafe/ops)
|
||||
|
||||
;; function with a mix of complex and non-complex args
|
||||
(let ((f (lambda: ((x : Inexact-Complex) (y : Float))
|
||||
(+ x y))))
|
||||
(f (+ 1.0+2.0i 2.0+4.0i)
|
||||
3.0))
|
|
@ -0,0 +1,9 @@
|
|||
#lang typed/scheme #:optimize
|
||||
|
||||
(require racket/unsafe/ops)
|
||||
|
||||
;; function with a mix of complex and non-complex args, non-complex first
|
||||
(let ((f (lambda: ((y : Float) (x : Inexact-Complex))
|
||||
(+ x y))))
|
||||
(f 3.0
|
||||
(+ 1.0+2.0i 2.0+4.0i)))
|
|
@ -0,0 +1,10 @@
|
|||
#lang typed/scheme #:optimize
|
||||
|
||||
(require racket/unsafe/ops)
|
||||
|
||||
;; invalid: f "escapes", according to our analysis
|
||||
(letrec: ((f : (Inexact-Complex -> Inexact-Complex)
|
||||
(lambda: ((x : Inexact-Complex))
|
||||
(let: ((y : (Inexact-Complex -> Inexact-Complex) f))
|
||||
x))))
|
||||
(f (+ 1.0+2.0i 2.0+4.0i)))
|
Loading…
Reference in New Issue
Block a user