;; -*-theme-d-*-

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

;; Expected results: translation error

(define-proper-program (tests test306)

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

  (define <number> (:union <integer> <real>))

  (define <op-proc> (:procedure ((rest <object>)) <object> nonpure))

  (define <op-spec> (:tuple <string> <op-proc> (:union <integer> <symbol>)
			    <symbol>))

  (define-simple-proc unary-op
      (((str-name <string>) (proc (:procedure (<number>) <number> pure)))
       <op-spec>
       pure)
    (let ((proc0 (lambda (((args (rest <object>))) <object> pure)
		   (proc (car (cast (:pair <number> <object>) args))))))
      (list str-name proc0 1 'push)))

  (define-simple-proc main (() <none> nonpure)
    (let ((op (unary-op "+-" -)))
      (console-display-line ((tuple-ref op 1) 1.5)))))
