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)
|
||||
(set-expr-type exp string-type))
|
||||
((eq? (expr-types exp) 'image)
|
||||
(get-record (send type-recs get-class-record '("Image" "draw2") #f
|
||||
((get-importer type-recs) '("Image" "draw2")
|
||||
(get-record (send type-recs get-class-record '("Image" "graphics") #f
|
||||
((get-importer type-recs) '("Image" "graphics")
|
||||
type-recs level (expr-src exp))) type-recs)
|
||||
(add-required c-class "Image" `("draw2") type-recs)
|
||||
(set-expr-type exp (make-ref-type "Image" '("draw2"))))
|
||||
(add-required c-class "Image" `("graphics") type-recs)
|
||||
(set-expr-type exp (make-ref-type "Image" '("graphics"))))
|
||||
(else (expr-types exp))) env))
|
||||
((bin-op? exp)
|
||||
(set-expr-type exp
|
||||
|
|
|
@ -2052,8 +2052,8 @@
|
|||
(make-image
|
||||
(lambda ()
|
||||
`(let ((temp-obj (make-object ,(if (send (types) require-prefix?
|
||||
'("Image" "draw2") (lambda () #f))
|
||||
'draw2.Image
|
||||
'("Image" "graphics") (lambda () #f))
|
||||
'graphics.Image
|
||||
'Image))))
|
||||
(send temp-obj Image-constructor-dynamic ,value)
|
||||
temp-obj))))
|
||||
|
@ -2070,7 +2070,7 @@
|
|||
(cond
|
||||
((eq? type string-type) make-string)
|
||||
((and (equal? "Image" (ref-type-class/iface type))
|
||||
(equal? '("draw2") (ref-type-path type)))
|
||||
(equal? '("graphics") (ref-type-path type)))
|
||||
(make-image))
|
||||
(else
|
||||
(error 'translate-literal (format "Translate literal given unknown type: ~s" type))))))
|
||||
|
|
|
@ -887,7 +887,7 @@
|
|||
(cond
|
||||
((and (equal? "Image" (send value my-name))
|
||||
(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)))
|
||||
(list (cadr ((send value fields-for-display)))))
|
||||
(else
|
||||
|
|
|
@ -10,6 +10,16 @@
|
|||
|
||||
;;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
|
||||
"class Simple {
|
||||
Simple() { }
|
||||
|
|
Loading…
Reference in New Issue
Block a user