;; -*-theme-d-*-

;; Copyright (C) 2008-2013 Tommi Höynälänmaa
;; Distributed under GNU General Public License version 3,
;; see file doc/GPL-3.

;; Expected results: translation and running OK


(define-proper-program (tests test14)


  (import (standard-library core)
	  (standard-library console-io))


  (define-class <a> <object> #t #f #f public ()
    ((contents (:mutable-vector <real>) public module)))

  (define-class <b> <a> #t #f #f public ()
    ((fld1 <integer> public module)))

  (define-class <c> <a> #t #f #f public ()
    ((fld1 <string> public module)))

  (define-param-proc-alt my-proc (%type)
    (lambda (((arg %type)) %type pure)
      (make <c> (make-mutable-vector <real> 5 2.0) "abc")))

  (define main
    (lambda (() <integer> nonpure)
      (let* ((obj <a> (cast <a> (make <b> (make-mutable-vector <real> 3 -1.5) 1)))
	     (obj2 (my-proc obj)))
	(console-display
	 (mutable-vector-ref (field-ref obj2 'contents) 0))
	(console-newline)
	0))))
