;; -*-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 test285)

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

  (define-param-logical-type :alist (%key %value)
    (:alist %key %value))

  (define-param-proc my-proc (%key %value)
      (((al (:alist %key %value)) (key %key))
       (:maybe %value)
       pure)
    (let ((pr (:maybe (:pair %key %value))
	      (assoc-general key al null equal?)))
      (if (not-null? pr)
	  (cdr (cast (:pair %key %value) pr))
	  null)))

  (define-simple-proc main (() <none> nonpure)
    (let* ((al '(("abc" . 1) ("def" . 2)))
	   (i (my-proc al "xyz")))
      (console-display i)
      (console-newline))))
