# Function contracts for multiple return values

**URL:** <https://racket.discourse.group/t/function-contracts-for-multiple-return-values/284>\
**Category:** Questions & Answers\
**Tags:** question\
**Created:** [November 27, 2021, 12:27am UTC](https://racket.discourse.group/t/function-contracts-for-multiple-return-values/284 "2021-11-27T00:27:18Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![badkins](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/badkins/32/99_2.png) [@badkins](https://racket.discourse.group/u/badkins)\
**Post date:** [November 27, 2021, 4:15pm UTC](https://racket.discourse.group/t/function-contracts-for-multiple-return-values/284/3 "2021-11-27T16:15:59Z")

</div>

It appears Sorawee's solution works perfectly. The contract is for a class method; hence, the entry for `this`. I'm very impressed with Racket's contract system!

```scheme
[ get-user-data
  (->i ([_ any/c] ; this
        [conn connection?]
        [reference-key string?]
        [type string?])
       (values [hsh (or/c hash? #f)]
               [ errors (hsh) (if (hash? hsh)
                                  '()
                                  (listof string?)) ])) ]

```

P.S. It looks like someone may have marked the previous reply solved prematurely, maybe an admin/moderator? May I humbly suggest we wait a period of time to allow the OP to mark a solution before doing so on their behalf? I was busy yesterday evening, so I was only able to test the solution today.

---

_[View the full topic](https://racket.discourse.group/t/function-contracts-for-multiple-return-values/284)._
