Changes to reflect name change of draw2 to graphics, tests for cyclic uses of interfaces
svn: r2009
This commit is contained in:
parent
dadb3ea6b5
commit
f73ccaaf95
|
@ -1366,11 +1366,11 @@
|
||||||
(add-required c-class "String" `("java" "lang") type-recs)
|
(add-required c-class "String" `("java" "lang") type-recs)
|
||||||
(set-expr-type exp string-type))
|
(set-expr-type exp string-type))
|
||||||
((eq? (expr-types exp) 'image)
|
((eq? (expr-types exp) 'image)
|
||||||
(get-record (send type-recs get-class-record '("Image" "draw2") #f
|
(get-record (send type-recs get-class-record '("Image" "graphics") #f
|
||||||
((get-importer type-recs) '("Image" "draw2")
|
((get-importer type-recs) '("Image" "graphics")
|
||||||
type-recs level (expr-src exp))) type-recs)
|
type-recs level (expr-src exp))) type-recs)
|
||||||
(add-required c-class "Image" `("draw2") type-recs)
|
(add-required c-class "Image" `("graphics") type-recs)
|
||||||
(set-expr-type exp (make-ref-type "Image" '("draw2"))))
|
(set-expr-type exp (make-ref-type "Image" '("graphics"))))
|
||||||
(else (expr-types exp))) env))
|
(else (expr-types exp))) env))
|
||||||
((bin-op? exp)
|
((bin-op? exp)
|
||||||
(set-expr-type exp
|
(set-expr-type exp
|
||||||
|
|
|
@ -2052,8 +2052,8 @@
|
||||||
(make-image
|
(make-image
|
||||||
(lambda ()
|
(lambda ()
|
||||||
`(let ((temp-obj (make-object ,(if (send (types) require-prefix?
|
`(let ((temp-obj (make-object ,(if (send (types) require-prefix?
|
||||||
'("Image" "draw2") (lambda () #f))
|
'("Image" "graphics") (lambda () #f))
|
||||||
'draw2.Image
|
'graphics.Image
|
||||||
'Image))))
|
'Image))))
|
||||||
(send temp-obj Image-constructor-dynamic ,value)
|
(send temp-obj Image-constructor-dynamic ,value)
|
||||||
temp-obj))))
|
temp-obj))))
|
||||||
|
@ -2070,7 +2070,7 @@
|
||||||
(cond
|
(cond
|
||||||
((eq? type string-type) make-string)
|
((eq? type string-type) make-string)
|
||||||
((and (equal? "Image" (ref-type-class/iface type))
|
((and (equal? "Image" (ref-type-class/iface type))
|
||||||
(equal? '("draw2") (ref-type-path type)))
|
(equal? '("graphics") (ref-type-path type)))
|
||||||
(make-image))
|
(make-image))
|
||||||
(else
|
(else
|
||||||
(error 'translate-literal (format "Translate literal given unknown type: ~s" type))))))
|
(error 'translate-literal (format "Translate literal given unknown type: ~s" type))))))
|
||||||
|
|
|
@ -887,7 +887,7 @@
|
||||||
(cond
|
(cond
|
||||||
((and (equal? "Image" (send value my-name))
|
((and (equal? "Image" (send value my-name))
|
||||||
(object-method-arity-includes? value 'Image-constructor-dynamic 1)
|
(object-method-arity-includes? value 'Image-constructor-dynamic 1)
|
||||||
(object-method-arity-includes? value 'movePinhole-draw2.Posn 1))
|
(object-method-arity-includes? value 'movePinhole-graphics.Posn 1))
|
||||||
;(printf "~a~n" ((send value fields-for-display)))
|
;(printf "~a~n" ((send value fields-for-display)))
|
||||||
(list (cadr ((send value fields-for-display)))))
|
(list (cadr ((send value fields-for-display)))))
|
||||||
(else
|
(else
|
||||||
|
|
|
@ -10,6 +10,16 @@
|
||||||
|
|
||||||
;;Execution tests that should pass
|
;;Execution tests that should pass
|
||||||
|
|
||||||
|
(execute-test
|
||||||
|
"interface A {
|
||||||
|
boolean s( B b);
|
||||||
|
}
|
||||||
|
class B implements A {
|
||||||
|
B() { }
|
||||||
|
boolean s( B b ) { return true; }
|
||||||
|
}"
|
||||||
|
language #f "Interface and class with cyclic reference")
|
||||||
|
|
||||||
(execute-test
|
(execute-test
|
||||||
"class Simple {
|
"class Simple {
|
||||||
Simple() { }
|
Simple() { }
|
||||||
|
|
Loading…
Reference in New Issue
Block a user