From e50e2eaa57033e09dd563d2ddd73608c9a96d3be Mon Sep 17 00:00:00 2001 From: Asumu Takikawa Date: Wed, 8 Oct 2014 01:57:22 -0400 Subject: [PATCH] Fix type for read-bitmap Closes PR 14729 --- .../typed-racket-more/typed/racket/draw.rkt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pkgs/typed-racket-pkgs/typed-racket-more/typed/racket/draw.rkt b/pkgs/typed-racket-pkgs/typed-racket-more/typed/racket/draw.rkt index 6837b01ca7..ea5854c1c7 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-more/typed/racket/draw.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-more/typed/racket/draw.rkt @@ -54,6 +54,9 @@ Radial-Gradient% Region%)) +(begin-for-syntax + (define -LoadFileKind (parse-type #'LoadFileKind))) + (type-environment [the-brush-list (make-Instance (parse-type #'Brush-List%))] [the-pen-list (make-Instance (parse-type #'Pen-List%))] @@ -62,8 +65,11 @@ (->optkey -PosInt -PosInt [Univ] #:backing-scale -Real #f (make-Instance (parse-type #'Bitmap%)))] [read-bitmap - (->opt (Un -Pathlike) [-Symbol (Un (make-Instance (parse-type #'Color%)) (-val #f)) Univ] - (make-Instance (parse-type #'Bitmap%)))] + (->optkey (Un -Pathlike -Input-Port) + [-LoadFileKind (Un (make-Instance (parse-type #'Color%)) (-val #f)) Univ] + #:backing-scale -Real #f + #:try-@2x? Univ #f + (make-Instance (parse-type #'Bitmap%)))] [make-color (->optkey -Byte -Byte -Byte [-Real]